From 09bfb95976b28b9d1f8d3cc0959381fcba389a4e Mon Sep 17 00:00:00 2001
From: prep <prep@lindenlab.com>
Date: Mon, 31 Jan 2011 16:23:22 -0500
Subject: Fix for Sh-512: Scales use their previous maximum value

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

diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index b60eb893c7..8fa6beb474 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -1934,7 +1934,7 @@ void LLPanelObject::refresh()
 	getChildView("Physics Density")->setVisible(enable_mesh);
 	getChildView("Physics Restitution")->setVisible(enable_mesh);
 
-	F32 max_scale = get_default_max_prim_scale();
+	F32 max_scale = DEFAULT_MAX_PRIM_SCALE_NO_MESH;
 	getChild<LLSpinCtrl>("Scale X")->setMaxValue(max_scale);
 	getChild<LLSpinCtrl>("Scale Y")->setMaxValue(max_scale);
 	getChild<LLSpinCtrl>("Scale Z")->setMaxValue(max_scale);
-- 
cgit v1.2.3


From 7205ad6d53224d5ade142c579d1c38b49f3d9885 Mon Sep 17 00:00:00 2001
From: "Brad Payne (Vir Linden)" <vir@lindenlab.com>
Date: Mon, 31 Jan 2011 18:03:39 -0500
Subject: SH-872 WIP - temporarily disabling problematic log output to see if
 that fixes crash on test machine

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

diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp
old mode 100644
new mode 100755
index 13e1023185..afeba6bdf0
--- a/indra/newview/llagentpilot.cpp
+++ b/indra/newview/llagentpilot.cpp
@@ -178,6 +178,8 @@ void LLAgentPilot::stopPlayback()
 	}
 }
 
+#define SKIP_PILOT_LOGGING 1
+
 void LLAgentPilot::updateTarget()
 {
 	if (mPlaying)
@@ -195,7 +197,9 @@ void LLAgentPilot::updateTarget()
 				{
 					if (!mStarted)
 					{
+#if SKIP_PILOT_LOGGING
 						llinfos << "At start, beginning playback" << llendl;
+#endif
 						mTimer.reset();
 						mStarted = TRUE;
 					}
@@ -218,17 +222,23 @@ void LLAgentPilot::updateTarget()
 					{
 						if ((mNumRuns < 0) || (mNumRuns > 0))
 						{
+#if SKIP_PILOT_LOGGING
 							llinfos << "Looping, restarting playback" << llendl;
+#endif
 							startPlayback();
 						}
 						else if (mQuitAfterRuns)
 						{
+#if SKIP_PILOT_LOGGING
 							llinfos << "Done with all runs, quitting viewer!" << llendl;
+#endif
 							LLAppViewer::instance()->forceQuit();
 						}
 						else
 						{
+#if SKIP_PILOT_LOGGING
 							llinfos << "Done with all runs, disabling pilot" << llendl;
+#endif
 							stopPlayback();
 						}
 					}
-- 
cgit v1.2.3


From 1a51db5b53b3783b002bfa870fa45244df8fafdc Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 1 Feb 2011 02:33:14 -0600
Subject: SH-641 Cosmetic fix -- keep showing last rendered mesh LoD if
 requested LoD is unavailable.

---
 indra/newview/llmeshrepository.cpp | 16 ++++++++++++++--
 indra/newview/llmeshrepository.h   |  2 +-
 indra/newview/llvovolume.cpp       |  3 ++-
 3 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp
index b772999ee2..edcf249a21 100755
--- a/indra/newview/llmeshrepository.cpp
+++ b/indra/newview/llmeshrepository.cpp
@@ -2160,7 +2160,7 @@ S32 LLMeshRepository::update()
 	return size ;
 }
 
-S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail)
+S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_params, S32 detail, S32 last_lod)
 {
 	if (detail < 0 || detail > 4)
 	{
@@ -2201,7 +2201,19 @@ S32 LLMeshRepository::loadMesh(LLVOVolume* vobj, const LLVolumeParams& mesh_para
 
 		if (group)
 		{
-			//first see what the next lowest LOD available might be
+			//first, see if last_lod is available (don't transition down to avoid funny popping a la SH-641)
+			if (last_lod >= 0)
+			{
+				LLVolume* lod = group->refLOD(last_lod);
+				if (lod && !lod->isTetrahedron() && lod->getNumVolumeFaces() > 0)
+				{
+					group->derefLOD(lod);
+					return last_lod;
+				}
+				group->derefLOD(lod);
+			}
+
+			//next, see what the next lowest LOD available might be
 			for (S32 i = detail-1; i >= 0; --i)
 			{
 				LLVolume* lod = group->refLOD(i);
diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h
index eccb82b661..b642a89192 100644
--- a/indra/newview/llmeshrepository.h
+++ b/indra/newview/llmeshrepository.h
@@ -456,7 +456,7 @@ public:
 	S32 update() ;
 
 	//mesh management functions
-	S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0);
+	S32 loadMesh(LLVOVolume* volume, const LLVolumeParams& mesh_params, S32 detail = 0, S32 last_lod = -1);
 	
 	void notifyLoadedMeshes();
 	void notifyMeshLoaded(const LLVolumeParams& mesh_params, LLVolume* volume);
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3dc82f5368..b296d21b2b 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -936,6 +936,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 {
 	LLVolumeParams volume_params = params_in;
 
+	S32 last_lod = mVolumep.notNull() ? LLVolumeLODGroup::getVolumeDetailFromScale(mVolumep->getDetail()) : -1;
 	S32 lod = mLOD;
 
 	BOOL is404 = FALSE;
@@ -1014,7 +1015,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
 				{ 
 					//load request not yet issued, request pipeline load this mesh
 					LLUUID asset_id = volume_params.getSculptID();
-					S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod);
+					S32 available_lod = gMeshRepo.loadMesh(this, volume_params, lod, last_lod);
 					if (available_lod != lod)
 					{
 						LLPrimitive::setVolume(volume_params, available_lod);
-- 
cgit v1.2.3


From ee39db49a38a626e72e1924e4c157b16d90e8ee6 Mon Sep 17 00:00:00 2001
From: Dave Parks <davep@lindenlab.com>
Date: Tue, 1 Feb 2011 03:13:47 -0600
Subject: SH-831 Fix for local lights option not disabling local lights.

---
 indra/newview/llviewercontrol.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 9bf0ae7c3e..414036c597 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -372,6 +372,12 @@ static bool handleRenderDynamicLODChanged(const LLSD& newvalue)
 	return true;
 }
 
+static bool handleRenderLocalLightsChanged(const LLSD& newvalue)
+{
+	gPipeline.setLightingDetail(-1);
+	return true;
+}
+
 static bool handleRenderDeferredChanged(const LLSD& newvalue)
 {
 	LLRenderTarget::sUseFBO = newvalue.asBoolean();
@@ -592,6 +598,7 @@ void settings_setup_listeners()
 	gSavedSettings.getControl("RenderFogRatio")->getSignal()->connect(boost::bind(&handleFogRatioChanged, _2));
 	gSavedSettings.getControl("RenderMaxPartCount")->getSignal()->connect(boost::bind(&handleMaxPartCountChanged, _2));
 	gSavedSettings.getControl("RenderDynamicLOD")->getSignal()->connect(boost::bind(&handleRenderDynamicLODChanged, _2));
+	gSavedSettings.getControl("RenderLocalLights")->getSignal()->connect(boost::bind(&handleRenderLocalLightsChanged, _2));
 	gSavedSettings.getControl("RenderDebugTextureBind")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderAutoMaskAlphaDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
 	gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
-- 
cgit v1.2.3