summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp40
1 files changed, 19 insertions, 21 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index e82fccde27..36daca174b 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"
@@ -3862,15 +3863,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;
@@ -3970,9 +3970,9 @@ void LLPipeline::rebuildPools()
max_count--;
}
- if (gAgent.getAvatarObject())
+ if (isAgentAvatarValid())
{
- gAgent.getAvatarObject()->rebuildHUD();
+ gAgentAvatarp->rebuildHUD();
}
}
@@ -4368,7 +4368,7 @@ void LLPipeline::calcNearbyLights(LLCamera& camera)
// mNearbyLight (and all light_set_t's) are sorted such that
// begin() == the closest light and rbegin() == the farthest light
const S32 MAX_LOCAL_LIGHTS = 6;
-// LLVector3 cam_pos = gAgent.getCameraPositionAgent();
+// LLVector3 cam_pos = gAgentCamera.getCameraPositionAgent();
LLVector3 cam_pos = LLViewerJoystick::getInstance()->getOverrideCamera() ?
camera.getOrigin() :
gAgent.getPositionAgent();
@@ -4604,8 +4604,8 @@ void LLPipeline::setupHWLights(LLDrawPool* pool)
glLightfv(gllight, GL_SPECULAR, LLColor4::black.mV);
}
- if (gAgent.getAvatarObject() &&
- gAgent.getAvatarObject()->mSpecialRenderMode == 3)
+ if (isAgentAvatarValid() &&
+ gAgentAvatarp->mSpecialRenderMode == 3)
{
LLColor4 light_color = LLColor4::white;
light_color.mV[3] = 0.0f;
@@ -4714,15 +4714,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));
}
@@ -7108,15 +7106,15 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
llpushcallstacks ;
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();
@@ -7340,9 +7338,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());
}
}
}