summaryrefslogtreecommitdiff
path: root/indra/newview/llviewerobjectlist.cpp
diff options
context:
space:
mode:
authorJames Cook <james@lindenlab.com>2010-05-11 16:11:09 -0700
committerJames Cook <james@lindenlab.com>2010-05-11 16:11:09 -0700
commit2b7153c26a6dd5284218253910f466a0faeff708 (patch)
tree8b8f54545c540d4e5f28d4a91215280117f52dff /indra/newview/llviewerobjectlist.cpp
parentbae06b4b62587bd567495e3940a323e4c635a63e (diff)
parent8e1dbbbb5628eee210a0a7c25f32287d7b754a8b (diff)
merge from dessie/viewer-public right before SLE code landed
Diffstat (limited to 'indra/newview/llviewerobjectlist.cpp')
-rw-r--r--indra/newview/llviewerobjectlist.cpp25
1 files changed, 16 insertions, 9 deletions
diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp
index d920e96ded..f682a05532 100644
--- a/indra/newview/llviewerobjectlist.cpp
+++ b/indra/newview/llviewerobjectlist.cpp
@@ -47,6 +47,7 @@
#include "llviewerwindow.h"
#include "llnetmap.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "pipeline.h"
#include "llspatialpartition.h"
#include "lltooltip.h"
@@ -288,7 +289,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
LLMemType mt(LLMemType::MTYPE_OBJECT_PROCESS_UPDATE);
LLFastTimer t(FTM_PROCESS_OBJECTS);
- LLVector3d camera_global = gAgent.getCameraPositionGlobal();
+ LLVector3d camera_global = gAgentCamera.getCameraPositionGlobal();
LLViewerObject *objectp;
S32 num_objects;
U32 local_id;
@@ -473,7 +474,6 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys,
if (objectp->getRegion() != regionp)
{ // Object changed region, so update it
- objectp->setRegion(regionp);
objectp->updateRegion(regionp); // for LLVOAvatar
}
}
@@ -614,7 +614,7 @@ void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
}
// Focused
- objectp = gAgent.getFocusObject();
+ objectp = gAgentCamera.getFocusObject();
if (objectp)
{
objectp->boostTexturePriority();
@@ -894,6 +894,13 @@ void LLViewerObjectList::removeDrawable(LLDrawable* drawablep)
BOOL LLViewerObjectList::killObject(LLViewerObject *objectp)
{
+ // Don't ever kill gAgentAvatarp, just mark it as null region instead.
+ if (objectp == gAgentAvatarp)
+ {
+ objectp->setRegion(NULL);
+ return FALSE;
+ }
+
// When we're killing objects, all we do is mark them as dead.
// We clean up the dead objects later.
@@ -942,7 +949,8 @@ void LLViewerObjectList::killAllObjects()
{
objectp = *iter;
killObject(objectp);
- llassert(objectp->isDead());
+ // Object must be dead, or it's the LLVOAvatarSelf which never dies.
+ llassert((objectp == gAgentAvatarp) || objectp->isDead());
}
cleanDeadObjects(FALSE);
@@ -1209,11 +1217,10 @@ void LLViewerObjectList::generatePickList(LLCamera &camera)
}
// add all hud objects to pick list
- LLVOAvatar* avatarp = gAgent.getAvatarObject();
- if (avatarp)
+ if (isAgentAvatarValid())
{
- 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;
@@ -1281,7 +1288,7 @@ void LLViewerObjectList::renderPickList(const LLRect& screen_rect, BOOL pick_par
gViewerWindow->renderSelections( TRUE, pick_parcel_wall, FALSE );
//fix for DEV-19335. Don't pick hud objects when customizing avatar (camera mode doesn't play nice with nametags).
- if (!gAgent.cameraCustomizeAvatar())
+ if (!gAgentCamera.cameraCustomizeAvatar())
{
// render pickable ui elements, like names, etc.
LLHUDObject::renderAllForSelect();