summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-03-30 13:15:36 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-03-30 13:15:36 +0100
commit61774546f0b260c18c5308143a9c3d02a5e5245e (patch)
tree4566b4f91c2e02956143647067ae642570bb907a /indra/newview/pipeline.cpp
parentccd5b9e2f3f1139814a63d9db03c3671c249930c (diff)
parente1517318c58d6796b5566d5cf96c02474fd7376e (diff)
HUGE merge from viewer-trunk. Many conflicts resolved.
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp63
1 files changed, 35 insertions, 28 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 26670351c6..3778cae201 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -56,6 +56,7 @@
// newview includes
#include "llagent.h"
+#include "llagentcamera.h"
#include "lldrawable.h"
#include "lldrawpoolalpha.h"
#include "lldrawpoolavatar.h"
@@ -907,18 +908,13 @@ S32 LLPipeline::setLightingDetail(S32 level)
if (level < 0)
{
- if (gSavedSettings.getBOOL("VertexShaderEnable"))
- {
- level = 1;
- }
- else
- {
- level = 0;
- }
+ level = gSavedSettings.getS32("RenderLightingDetail");
}
level = llclamp(level, 0, getMaxLightingDetail());
if (level != mLightingDetail)
{
+ gSavedSettings.setS32("RenderLightingDetail", level);
+
mLightingDetail = level;
if (mVertexShadersLoaded == 1)
@@ -3430,6 +3426,20 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera)
gGLLastMatrix = NULL;
glLoadMatrixd(gGLModelView);
+ renderHighlights();
+ mHighlightFaces.clear();
+
+ renderDebug();
+
+ LLVertexBuffer::unbind();
+
+ if (gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI))
+ {
+ // Render debugging beacons.
+ gObjectList.renderObjectBeacons();
+ gObjectList.resetObjectBeacons();
+ }
+
if (occlude)
{
occlude = FALSE;
@@ -3927,15 +3937,14 @@ void LLPipeline::renderForSelect(std::set<LLViewerObject*>& objects, BOOL render
}
// pick HUD objects
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
- if (avatarp && sShowHUDAttachments)
+ if (isAgentAvatarValid() && sShowHUDAttachments)
{
glh::matrix4f save_proj(glh_get_current_projection());
glh::matrix4f save_model(glh_get_current_modelview());
setup_hud_matrices(screen_rect);
- for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin();
- iter != avatarp->mAttachmentPoints.end(); )
+ for (LLVOAvatar::attachment_map_t::iterator iter = gAgentAvatarp->mAttachmentPoints.begin();
+ iter != gAgentAvatarp->mAttachmentPoints.end(); )
{
LLVOAvatar::attachment_map_t::iterator curiter = iter++;
LLViewerJointAttachment* attachment = curiter->second;
@@ -4035,9 +4044,9 @@ void LLPipeline::rebuildPools()
max_count--;
}
- if (gAgent.getAvatarObject())
+ if (isAgentAvatarValid())
{
- gAgent.getAvatarObject()->rebuildHUD();
+ gAgentAvatarp->rebuildHUD();
}
}
@@ -4677,8 +4686,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
glLightfv(gllight, GL_AMBIENT, LLColor4::black.mV);
glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
}
- if (gAgent.getAvatarObject() &&
- gAgent.getAvatarObject()->mSpecialRenderMode == 3)
+ if (gAgentAvatarp &&
+ gAgentAvatarp->mSpecialRenderMode == 3)
{
LLColor4 light_color = LLColor4::white;
light_color.mV[3] = 0.0f;
@@ -4784,15 +4793,13 @@ void LLPipeline::enableLightsDynamic()
glColor4f(0.f, 0.f, 0.f, 1.f); // no local lighting by default
}
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
-
- if (avatarp && getLightingDetail() <= 0)
+ if (isAgentAvatarValid() && getLightingDetail() <= 0)
{
- if (avatarp->mSpecialRenderMode == 0) // normal
+ if (gAgentAvatarp->mSpecialRenderMode == 0) // normal
{
gPipeline.enableLightsAvatar();
}
- else if (avatarp->mSpecialRenderMode >= 1) // anim preview
+ else if (gAgentAvatarp->mSpecialRenderMode >= 1) // anim preview
{
gPipeline.enableLightsAvatarEdit(LLColor4(0.7f, 0.6f, 0.3f, 1.f));
}
@@ -7205,15 +7212,15 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{
- LLVOAvatarSelf* avatar = gAgent.getAvatarObject();
- if (gAgent.getCameraAnimating() || gAgent.getCameraMode() != CAMERA_MODE_MOUSELOOK)
+ BOOL skip_avatar_update = FALSE;
+ if (gAgentCamera.getCameraAnimating() || gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK)
{
- avatar = NULL;
+ skip_avatar_update = TRUE;
}
- if (avatar)
+ if (!skip_avatar_update)
{
- avatar->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON);
+ gAgentAvatarp->updateAttachmentVisibility(CAMERA_MODE_THIRD_PERSON);
}
LLVertexBuffer::unbind();
@@ -7436,9 +7443,9 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
LLGLState::checkTextureChannels();
LLGLState::checkClientArrays();
- if (avatar)
+ if (!skip_avatar_update)
{
- avatar->updateAttachmentVisibility(gAgent.getCameraMode());
+ gAgentAvatarp->updateAttachmentVisibility(gAgentCamera.getCameraMode());
}
}
}