Catch up with viewer-beta. Primarily sim transition alterations to reduce frame hitching, and some optimization in LLViewerObjectList (std::set -> std::vector and and some allocation tweakage).
This commit is contained in:
@@ -63,6 +63,8 @@ const F32 MIN_SHADOW_CASTER_RADIUS = 2.0f;
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound");
|
||||
|
||||
extern bool gShiftFrame;
|
||||
|
||||
|
||||
////////////////////////
|
||||
//
|
||||
@@ -722,6 +724,11 @@ void LLDrawable::updateDistance(LLCamera& camera, bool force_update)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gShiftFrame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
//switch LOD with the spatial group to avoid artifacts
|
||||
//LLSpatialGroup* sg = getSpatialGroup();
|
||||
|
||||
@@ -820,14 +827,19 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
|
||||
mXform.setPosition(mVObjp->getPositionAgent());
|
||||
}
|
||||
|
||||
mXform.setRotation(mVObjp->getRotation());
|
||||
mXform.setScale(1,1,1);
|
||||
mXform.updateMatrix();
|
||||
|
||||
if (isStatic())
|
||||
{
|
||||
LLVOVolume* volume = getVOVolume();
|
||||
if (!volume)
|
||||
|
||||
bool rebuild = (!volume &&
|
||||
getRenderType() != LLPipeline::RENDER_TYPE_TREE &&
|
||||
getRenderType() != LLPipeline::RENDER_TYPE_TERRAIN &&
|
||||
getRenderType() != LLPipeline::RENDER_TYPE_SKY &&
|
||||
getRenderType() != LLPipeline::RENDER_TYPE_GROUND);
|
||||
|
||||
if (rebuild)
|
||||
{
|
||||
gPipeline.markRebuild(this, LLDrawable::REBUILD_ALL, TRUE);
|
||||
}
|
||||
@@ -841,7 +853,7 @@ void LLDrawable::shiftPos(const LLVector4a &shift_vector)
|
||||
facep->mExtents[0].add(shift_vector);
|
||||
facep->mExtents[1].add(shift_vector);
|
||||
|
||||
if (!volume && facep->hasGeometry())
|
||||
if (rebuild && facep->hasGeometry())
|
||||
{
|
||||
facep->clearVertexBuffer();
|
||||
}
|
||||
@@ -960,6 +972,12 @@ LLSpatialGroup* LLDrawable::getSpatialGroup() const
|
||||
|
||||
void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
|
||||
{
|
||||
//precondition: mSpatialGroupp MUST be null or DEAD or mSpatialGroupp MUST NOT contain this
|
||||
llassert(!mSpatialGroupp || mSpatialGroupp->isDead() || !mSpatialGroupp->hasElement(this));
|
||||
|
||||
//precondition: groupp MUST be null or groupp MUST contain this
|
||||
llassert(!groupp || groupp->hasElement(this));
|
||||
|
||||
/*if (mSpatialGroupp && (groupp != mSpatialGroupp))
|
||||
{
|
||||
mSpatialGroupp->setState(LLSpatialGroup::GEOM_DIRTY);
|
||||
@@ -979,9 +997,12 @@ void LLDrawable::setSpatialGroup(LLSpatialGroup *groupp)
|
||||
}
|
||||
}
|
||||
|
||||
mSpatialGroupp = groupp;
|
||||
//postcondition: if next group is NULL, previous group must be dead OR NULL OR binIndex must be -1
|
||||
//postcondition: if next group is NOT NULL, binIndex must not be -1
|
||||
llassert(groupp == NULL ? (mSpatialGroupp == NULL || mSpatialGroupp->isDead()) || getBinIndex() == -1 :
|
||||
getBinIndex() != -1);
|
||||
|
||||
llassert((mSpatialGroupp == NULL) ? getBinIndex() == -1 : getBinIndex() != -1);
|
||||
mSpatialGroupp = groupp;
|
||||
}
|
||||
|
||||
LLSpatialPartition* LLDrawable::getSpatialPartition()
|
||||
@@ -1416,6 +1437,11 @@ void LLSpatialBridge::updateDistance(LLCamera& camera_in, bool force_update)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gShiftFrame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mDrawable->getVObj())
|
||||
{
|
||||
if (mDrawable->getVObj()->isAttachment())
|
||||
@@ -1499,13 +1525,11 @@ void LLSpatialBridge::cleanupReferences()
|
||||
LLDrawable::cleanupReferences();
|
||||
if (mDrawable)
|
||||
{
|
||||
LLSpatialGroup* group = mDrawable->getSpatialGroup();
|
||||
if (group)
|
||||
{
|
||||
group->mOctreeNode->remove(mDrawable);
|
||||
mDrawable->setSpatialGroup(NULL);
|
||||
}
|
||||
/*
|
||||
|
||||
DON'T DO THIS -- this should happen through octree destruction
|
||||
|
||||
mDrawable->setSpatialGroup(NULL);
|
||||
if (mDrawable->getVObj())
|
||||
{
|
||||
LLViewerObject::const_child_list_t& child_list = mDrawable->getVObj()->getChildren();
|
||||
@@ -1516,15 +1540,10 @@ void LLSpatialBridge::cleanupReferences()
|
||||
LLDrawable* drawable = child->mDrawable;
|
||||
if (drawable)
|
||||
{
|
||||
LLSpatialGroup* group = drawable->getSpatialGroup();
|
||||
if (group)
|
||||
{
|
||||
group->mOctreeNode->remove(drawable);
|
||||
drawable->setSpatialGroup(NULL);
|
||||
}
|
||||
drawable->setSpatialGroup(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
LLDrawable* drawablep = mDrawable;
|
||||
mDrawable = NULL;
|
||||
|
||||
@@ -257,48 +257,6 @@ void LLFacePool::dirtyTextures(const std::set<LLViewerFetchedTexture*>& textures
|
||||
{
|
||||
}
|
||||
|
||||
// static
|
||||
S32 LLFacePool::drawLoop(face_array_t& face_list)
|
||||
{
|
||||
S32 res = 0;
|
||||
if (!face_list.empty())
|
||||
{
|
||||
for (std::vector<LLFace*>::iterator iter = face_list.begin();
|
||||
iter != face_list.end(); iter++)
|
||||
{
|
||||
LLFace *facep = *iter;
|
||||
res += facep->renderIndexed();
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
// static
|
||||
S32 LLFacePool::drawLoopSetTex(face_array_t& face_list, S32 stage)
|
||||
{
|
||||
S32 res = 0;
|
||||
if (!face_list.empty())
|
||||
{
|
||||
for (std::vector<LLFace*>::iterator iter = face_list.begin();
|
||||
iter != face_list.end(); iter++)
|
||||
{
|
||||
LLFace *facep = *iter;
|
||||
gGL.getTexUnit(stage)->bind(facep->getTexture(), TRUE);
|
||||
gGL.getTexUnit(0)->activate();
|
||||
res += facep->renderIndexed();
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
void LLFacePool::drawLoop()
|
||||
{
|
||||
if (!mDrawFace.empty())
|
||||
{
|
||||
drawLoop(mDrawFace);
|
||||
}
|
||||
}
|
||||
|
||||
void LLFacePool::enqueue(LLFace* facep)
|
||||
{
|
||||
mDrawFace.push_back(facep);
|
||||
|
||||
@@ -192,10 +192,6 @@ public:
|
||||
|
||||
void buildEdges();
|
||||
|
||||
static S32 drawLoop(face_array_t& face_list);
|
||||
static S32 drawLoopSetTex(face_array_t& face_list, S32 stage);
|
||||
void drawLoop();
|
||||
|
||||
void addFaceReference(LLFace *facep);
|
||||
void removeFaceReference(LLFace *facep);
|
||||
|
||||
|
||||
@@ -1040,9 +1040,13 @@ void LLDrawPoolAvatar::endDeferredSkinned()
|
||||
gGL.getTexUnit(0)->activate();
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RENDER_AVATARS("renderAvatars");
|
||||
|
||||
|
||||
void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
|
||||
{
|
||||
LLFastTimer t(FTM_RENDER_AVATARS);
|
||||
|
||||
if (pass == -1)
|
||||
{
|
||||
for (S32 i = 1; i < getNumPasses(); i++)
|
||||
@@ -1546,8 +1550,12 @@ void LLDrawPoolAvatar::renderDeferredRiggedBump(LLVOAvatar* avatar)
|
||||
renderRigged(avatar, RIGGED_DEFERRED_BUMP);
|
||||
}
|
||||
|
||||
static LLFastTimer::DeclareTimer FTM_RIGGED_VBO("Rigged VBO");
|
||||
|
||||
void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar)
|
||||
{
|
||||
LLFastTimer t(FTM_RIGGED_VBO);
|
||||
|
||||
//update rigged vertex buffers
|
||||
for (U32 type = 0; type < NUM_RIGGED_PASSES; ++type)
|
||||
{
|
||||
|
||||
@@ -302,6 +302,34 @@ void LLDrawPoolTerrain::renderShadow(S32 pass)
|
||||
//glCullFace(GL_BACK);
|
||||
}
|
||||
|
||||
|
||||
void LLDrawPoolTerrain::drawLoop()
|
||||
{
|
||||
if (!mDrawFace.empty())
|
||||
{
|
||||
for (std::vector<LLFace*>::iterator iter = mDrawFace.begin();
|
||||
iter != mDrawFace.end(); iter++)
|
||||
{
|
||||
LLFace *facep = *iter;
|
||||
|
||||
LLMatrix4* model_matrix = &(facep->getDrawable()->getRegion()->mRenderMatrix);
|
||||
|
||||
if (model_matrix != gGLLastMatrix)
|
||||
{
|
||||
gGLLastMatrix = model_matrix;
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
if (model_matrix)
|
||||
{
|
||||
gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
|
||||
}
|
||||
gPipeline.mMatrixOpCount++;
|
||||
}
|
||||
|
||||
facep->renderIndexed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLDrawPoolTerrain::renderFullShader()
|
||||
{
|
||||
// Hack! Get the region that this draw pool is rendering from!
|
||||
|
||||
@@ -89,6 +89,7 @@ protected:
|
||||
void renderFull2TU();
|
||||
void renderFull4TU();
|
||||
void renderFullShader();
|
||||
void drawLoop();
|
||||
};
|
||||
|
||||
#endif // LL_LLDRAWPOOLSIMPLE_H
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include "llviewershadermgr.h"
|
||||
#include "llrender.h"
|
||||
#include "llviewercontrol.h"
|
||||
#include "llviewerregion.h"
|
||||
|
||||
S32 LLDrawPoolTree::sDiffTex = 0;
|
||||
static LLGLSLShader* shader = NULL;
|
||||
@@ -116,8 +117,22 @@ void LLDrawPoolTree::render(S32 pass)
|
||||
{
|
||||
LLFace *face = *iter;
|
||||
LLVertexBuffer* buff = face->getVertexBuffer();
|
||||
|
||||
if(buff)
|
||||
{
|
||||
LLMatrix4* model_matrix = &(face->getDrawable()->getRegion()->mRenderMatrix);
|
||||
|
||||
if (model_matrix != gGLLastMatrix)
|
||||
{
|
||||
gGLLastMatrix = model_matrix;
|
||||
gGL.loadMatrix(gGLModelView);
|
||||
if (model_matrix)
|
||||
{
|
||||
gGL.multMatrix((GLfloat*) model_matrix->mMatrix);
|
||||
}
|
||||
gPipeline.mMatrixOpCount++;
|
||||
}
|
||||
|
||||
buff->setBuffer(LLDrawPoolTree::VERTEX_DATA_MASK);
|
||||
buff->drawRange(LLRender::TRIANGLES, 0, buff->getNumVerts()-1, buff->getNumIndices(), 0);
|
||||
gPipeline.addTrianglesDrawn(buff->getNumIndices());
|
||||
|
||||
@@ -73,6 +73,7 @@ const F32 SG_OCCLUSION_FUDGE = 0.25f;
|
||||
#define assert_states_valid(x)
|
||||
#endif
|
||||
|
||||
extern bool gShiftFrame;
|
||||
|
||||
static U32 sZombieGroups = 0;
|
||||
U32 LLSpatialGroup::sNodeCount = 0;
|
||||
@@ -806,7 +807,10 @@ void LLSpatialGroup::shift(const LLVector4a &offset)
|
||||
mObjectExtents[0].add(offset);
|
||||
mObjectExtents[1].add(offset);
|
||||
|
||||
if (!mSpatialPartition->mRenderByGroup)
|
||||
if (!mSpatialPartition->mRenderByGroup &&
|
||||
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TREE &&
|
||||
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_TERRAIN &&
|
||||
mSpatialPartition->mPartitionType != LLViewerRegion::PARTITION_BRIDGE)
|
||||
{
|
||||
setState(GEOM_DIRTY);
|
||||
gPipeline.markRebuild(this, TRUE);
|
||||
@@ -1121,6 +1125,11 @@ void LLSpatialGroup::updateDistance(LLCamera &camera)
|
||||
return;
|
||||
}
|
||||
|
||||
if (gShiftFrame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#if !LL_RELEASE_FOR_DOWNLOAD
|
||||
if (isState(LLSpatialGroup::OBJECT_DIRTY))
|
||||
{
|
||||
@@ -1735,6 +1744,8 @@ BOOL LLSpatialPartition::remove(LLDrawable *drawablep, LLSpatialGroup *curp)
|
||||
drawablep->setSpatialGroup(NULL);
|
||||
}
|
||||
|
||||
drawablep->setSpatialGroup(NULL);
|
||||
|
||||
assert_octree_valid(mOctree);
|
||||
|
||||
return TRUE;
|
||||
|
||||
@@ -352,9 +352,10 @@ public:
|
||||
void dirtyMesh() { setState(MESH_DIRTY); }
|
||||
|
||||
//octree wrappers to make code more readable
|
||||
//element_list& getData() { return mOctreeNode->getData(); }
|
||||
//element_list& getData() { return mOctreeNode->getData(); } //unused
|
||||
element_iter getDataBegin() { return mOctreeNode->getDataBegin(); }
|
||||
element_iter getDataEnd() { return mOctreeNode->getDataEnd(); }
|
||||
bool hasElement(LLDrawable* drawablep) { return std::find(mOctreeNode->getDataBegin(), mOctreeNode->getDataEnd(), drawablep) != mOctreeNode->getDataEnd(); }
|
||||
U32 getElementCount() const { return mOctreeNode->getElementCount(); }
|
||||
bool isEmpty() const { return mOctreeNode->isEmpty(); }
|
||||
|
||||
|
||||
@@ -61,6 +61,7 @@
|
||||
#include "lldrawable.h"
|
||||
|
||||
extern LLPipeline gPipeline;
|
||||
extern bool gShiftFrame;
|
||||
|
||||
LLColor4U MAX_WATER_COLOR(0, 48, 96, 240);
|
||||
|
||||
@@ -351,13 +352,21 @@ void LLSurface::getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegio
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void LLSurface::getNeighboringRegionsStatus( std::vector<S32>& regions )
|
||||
{
|
||||
S32 i;
|
||||
for (i = 0; i < 8; i++)
|
||||
{
|
||||
if ( mNeighbors[i] != NULL )
|
||||
{
|
||||
regions.push_back( i );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLSurface::connectNeighbor(LLSurface *neighborp, U32 direction)
|
||||
{
|
||||
if (gNoRender)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
S32 i;
|
||||
LLSurfacePatch *patchp, *neighbor_patchp;
|
||||
|
||||
@@ -618,6 +627,11 @@ void LLSurface::moveZ(const S32 x, const S32 y, const F32 delta)
|
||||
|
||||
void LLSurface::updatePatchVisibilities(LLAgent &agent)
|
||||
{
|
||||
if (gShiftFrame)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
LLVector3 pos_region = mRegionp->getPosRegionFromGlobal(gAgentCamera.getCameraPositionGlobal());
|
||||
|
||||
LLSurfacePatch *patchp;
|
||||
|
||||
@@ -148,6 +148,7 @@ public:
|
||||
friend std::ostream& operator<<(std::ostream &s, const LLSurface &S);
|
||||
|
||||
void getNeighboringRegions( std::vector<LLViewerRegion*>& uniqueRegions );
|
||||
void getNeighboringRegionsStatus( std::vector<S32>& regions );
|
||||
|
||||
public:
|
||||
// Number of grid points on one side of a region, including +1 buffer for
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
#include "lldrawpool.h"
|
||||
#include "noise.h"
|
||||
|
||||
extern bool gShiftFrame;
|
||||
extern U64 gFrameTime;
|
||||
extern LLPipeline gPipeline;
|
||||
|
||||
@@ -224,7 +225,7 @@ void LLSurfacePatch::eval(const U32 x, const U32 y, const U32 stride, LLVector3
|
||||
pos_agent.mV[VX] += x * mSurfacep->getMetersPerGrid();
|
||||
pos_agent.mV[VY] += y * mSurfacep->getMetersPerGrid();
|
||||
pos_agent.mV[VZ] = *(mDataZ + point_offset);
|
||||
*vertex = pos_agent;
|
||||
*vertex = pos_agent-mVObjp->getRegion()->getOriginAgent();
|
||||
|
||||
LLVector3 rel_pos = pos_agent - mSurfacep->getOriginAgent();
|
||||
LLVector3 tex_pos = rel_pos * (1.f/surface_stride);
|
||||
@@ -372,10 +373,13 @@ void LLSurfacePatch::updateCameraDistanceRegion(const LLVector3 &pos_region)
|
||||
{
|
||||
if (LLPipeline::sDynamicLOD)
|
||||
{
|
||||
LLVector3 dv = pos_region;
|
||||
dv -= mCenterRegion;
|
||||
mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/
|
||||
llmax(LLVOSurfacePatch::sLODFactor, 0.1f);
|
||||
if (!gShiftFrame)
|
||||
{
|
||||
LLVector3 dv = pos_region;
|
||||
dv -= mCenterRegion;
|
||||
mVisInfo.mDistance = llmax(0.f, (F32)(dv.magVec() - mRadius))/
|
||||
llmax(LLVOSurfacePatch::sLODFactor, 0.1f);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -90,6 +90,8 @@
|
||||
#include "rlvlocks.h"
|
||||
// [/RLVa:KB]
|
||||
|
||||
extern bool gShiftFrame;
|
||||
|
||||
LLPointer<LLViewerTexture> gDisconnectedImagep = NULL;
|
||||
|
||||
// used to toggle renderer back on after teleport
|
||||
@@ -1109,6 +1111,8 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
|
||||
display_stats();
|
||||
|
||||
LLAppViewer::instance()->pingMainloopTimeout("Display:Done");
|
||||
|
||||
gShiftFrame = false;
|
||||
}
|
||||
|
||||
void render_hud_attachments()
|
||||
|
||||
@@ -207,6 +207,7 @@ static const U32 LLREQUEST_PERMISSION_THROTTLE_LIMIT = 5; // requests
|
||||
static const F32 LLREQUEST_PERMISSION_THROTTLE_INTERVAL = 10.0f; // seconds
|
||||
|
||||
extern BOOL gDebugClicks;
|
||||
extern bool gShiftFrame;
|
||||
|
||||
// function prototypes
|
||||
bool check_offer_throttle(const std::string& from_name, bool check_only);
|
||||
@@ -4208,6 +4209,7 @@ void process_avatar_init_complete(LLMessageSystem* msg, void**)
|
||||
|
||||
void process_agent_movement_complete(LLMessageSystem* msg, void**)
|
||||
{
|
||||
gShiftFrame = true;
|
||||
gAgentMovementCompleted = true;
|
||||
|
||||
LLUUID agent_id;
|
||||
|
||||
@@ -205,6 +205,7 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe
|
||||
mID(id),
|
||||
mLocalID(0),
|
||||
mTotalCRC(0),
|
||||
mListIndex(-1),
|
||||
mTEImages(NULL),
|
||||
mGLName(0),
|
||||
mbCanSelect(TRUE),
|
||||
|
||||
@@ -219,6 +219,8 @@ public:
|
||||
const LLUUID &getID() const { return mID; }
|
||||
U32 getLocalID() const { return mLocalID; }
|
||||
U32 getCRC() const { return mTotalCRC; }
|
||||
S32 getListIndex() const { return mListIndex; }
|
||||
void setListIndex(S32 idx) { mListIndex = idx; }
|
||||
|
||||
virtual BOOL isFlexible() const { return FALSE; }
|
||||
virtual BOOL isSculpted() const { return FALSE; }
|
||||
@@ -603,6 +605,9 @@ public:
|
||||
// Last total CRC received from sim, used for caching
|
||||
U32 mTotalCRC;
|
||||
|
||||
// index into LLViewerObjectList::mActiveObjects or -1 if not in list
|
||||
S32 mListIndex;
|
||||
|
||||
LLPointer<LLViewerTexture> *mTEImages;
|
||||
|
||||
// Selection, picking and rendering variables
|
||||
|
||||
@@ -922,21 +922,32 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
|
||||
LLViewerObject *objectp = NULL;
|
||||
|
||||
// Make a copy of the list in case something in idleUpdate() messes with it
|
||||
std::vector<LLViewerObject*> idle_list;
|
||||
|
||||
static std::vector<LLViewerObject*> idle_list;
|
||||
if(mActiveObjects.size() > idle_list.capacity())
|
||||
idle_list.reserve( mActiveObjects.size() );
|
||||
|
||||
U32 idle_count = 0;
|
||||
|
||||
static LLFastTimer::DeclareTimer idle_copy("Idle Copy");
|
||||
|
||||
{
|
||||
LLFastTimer t(idle_copy);
|
||||
idle_list.reserve( mActiveObjects.size() );
|
||||
|
||||
for (std::set<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
|
||||
for (std::vector<LLPointer<LLViewerObject> >::iterator active_iter = mActiveObjects.begin();
|
||||
active_iter != mActiveObjects.end(); active_iter++)
|
||||
{
|
||||
objectp = *active_iter;
|
||||
if (objectp)
|
||||
{
|
||||
idle_list.push_back( objectp );
|
||||
if (idle_count >= idle_list.size())
|
||||
{
|
||||
idle_list.push_back( objectp );
|
||||
}
|
||||
else
|
||||
{
|
||||
idle_list[idle_count] = objectp;
|
||||
}
|
||||
++idle_count;
|
||||
}
|
||||
else
|
||||
{ // There shouldn't be any NULL pointers in the list, but they have caused
|
||||
@@ -945,12 +956,14 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<LLViewerObject*>::iterator idle_end = idle_list.begin()+idle_count;
|
||||
|
||||
static const LLCachedControl<bool> freeze_time("FreezeTime",0);
|
||||
if (freeze_time)
|
||||
{
|
||||
for (std::vector<LLViewerObject*>::iterator iter = idle_list.begin();
|
||||
iter != idle_list.end(); iter++)
|
||||
iter != idle_end; iter++)
|
||||
{
|
||||
objectp = *iter;
|
||||
if (
|
||||
@@ -966,17 +979,17 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world)
|
||||
else
|
||||
{
|
||||
for (std::vector<LLViewerObject*>::iterator idle_iter = idle_list.begin();
|
||||
idle_iter != idle_list.end(); idle_iter++)
|
||||
idle_iter != idle_end; idle_iter++)
|
||||
{
|
||||
objectp = *idle_iter;
|
||||
if (!objectp->idleUpdate(agent, world, frame_time))
|
||||
if (objectp->idleUpdate(agent, world, frame_time))
|
||||
{
|
||||
// If Idle Update returns false, kill object!
|
||||
kill_list.push_back(objectp);
|
||||
num_active_objects++;
|
||||
}
|
||||
else
|
||||
{
|
||||
num_active_objects++;
|
||||
// If Idle Update returns false, kill object!
|
||||
kill_list.push_back(objectp);
|
||||
}
|
||||
}
|
||||
for (std::vector<LLViewerObject*>::iterator kill_iter = kill_list.begin();
|
||||
@@ -1219,7 +1232,7 @@ void LLViewerObjectList::cleanupReferences(LLViewerObject *objectp)
|
||||
{
|
||||
//llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list in cleanupReferences." << llendl;
|
||||
objectp->setOnActiveList(FALSE);
|
||||
mActiveObjects.erase(objectp);
|
||||
removeFromActiveList(objectp);
|
||||
}
|
||||
|
||||
if (objectp->isOnMap())
|
||||
@@ -1409,6 +1422,26 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer)
|
||||
mNumDeadObjects = 0;
|
||||
}
|
||||
|
||||
void LLViewerObjectList::removeFromActiveList(LLViewerObject* objectp)
|
||||
{
|
||||
S32 idx = objectp->getListIndex();
|
||||
if (idx != -1)
|
||||
{ //remove by moving last element to this object's position
|
||||
llassert(mActiveObjects[idx] == objectp);
|
||||
|
||||
objectp->setListIndex(-1);
|
||||
|
||||
S32 last_index = mActiveObjects.size()-1;
|
||||
|
||||
if (idx != last_index)
|
||||
{
|
||||
mActiveObjects[idx] = mActiveObjects[last_index];
|
||||
mActiveObjects[idx]->setListIndex(idx);
|
||||
mActiveObjects.pop_back();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLViewerObjectList::updateActive(LLViewerObject *objectp)
|
||||
{
|
||||
LLMemType mt(LLMemType::MTYPE_OBJECT);
|
||||
@@ -1423,13 +1456,29 @@ void LLViewerObjectList::updateActive(LLViewerObject *objectp)
|
||||
if (active)
|
||||
{
|
||||
//llinfos << "Adding " << objectp->mID << " " << objectp->getPCodeString() << " to active list." << llendl;
|
||||
mActiveObjects.insert(objectp);
|
||||
objectp->setOnActiveList(TRUE);
|
||||
S32 idx = objectp->getListIndex();
|
||||
if (idx <= -1)
|
||||
{
|
||||
mActiveObjects.push_back(objectp);
|
||||
objectp->setListIndex(mActiveObjects.size()-1);
|
||||
objectp->setOnActiveList(TRUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
llassert(idx < mActiveObjects.size());
|
||||
llassert(mActiveObjects[idx] == objectp);
|
||||
|
||||
if (idx >= (S32)mActiveObjects.size() ||
|
||||
mActiveObjects[idx] != objectp)
|
||||
{
|
||||
llwarns << "Invalid object list index detected!" << llendl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//llinfos << "Removing " << objectp->mID << " " << objectp->getPCodeString() << " from active list." << llendl;
|
||||
mActiveObjects.erase(objectp);
|
||||
removeFromActiveList(objectp);
|
||||
objectp->setOnActiveList(FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,9 @@ public:
|
||||
|
||||
void dirtyAllObjectInventory();
|
||||
|
||||
void removeFromActiveList(LLViewerObject* objectp);
|
||||
void updateActive(LLViewerObject *objectp);
|
||||
|
||||
void updateAvatarVisibility();
|
||||
|
||||
// Selection related stuff
|
||||
@@ -206,7 +208,7 @@ public:
|
||||
typedef std::vector<LLPointer<LLViewerObject> > vobj_list_t;
|
||||
|
||||
vobj_list_t mObjects;
|
||||
std::set<LLPointer<LLViewerObject> > mActiveObjects;
|
||||
std::vector<LLPointer<LLViewerObject> > mActiveObjects;
|
||||
|
||||
vobj_list_t mMapObjects;
|
||||
|
||||
|
||||
@@ -389,7 +389,7 @@ BOOL LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time)
|
||||
// *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();
|
||||
const LLVector3 &this_position = getPositionRegion();
|
||||
if (this_position != mLastPosition)
|
||||
{
|
||||
gPipeline.markRebuild(mDrawable, LLDrawable::REBUILD_POSITION);
|
||||
@@ -858,10 +858,10 @@ void LLVOTree::updateMesh()
|
||||
LLMatrix4 matrix;
|
||||
|
||||
// Translate to tree base HACK - adjustment in Z plants tree underground
|
||||
const LLVector3 &pos_agent = getPositionAgent();
|
||||
const LLVector3 &pos_region = getPositionRegion();
|
||||
//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.setTranslation(pos_region.mV[VX], pos_region.mV[VY], pos_region.mV[VZ] - 0.1f);
|
||||
trans_mat *= matrix;
|
||||
|
||||
// Rotate to tree position and bend for current trunk/wind
|
||||
|
||||
@@ -142,6 +142,8 @@ void check_stack_depth(S32 stack_depth)
|
||||
//#define DEBUG_INDICES
|
||||
#endif
|
||||
|
||||
bool gShiftFrame = false;
|
||||
|
||||
const F32 BACKLIGHT_DAY_MAGNITUDE_AVATAR = 0.2f;
|
||||
const F32 BACKLIGHT_NIGHT_MAGNITUDE_AVATAR = 0.1f;
|
||||
const F32 BACKLIGHT_DAY_MAGNITUDE_OBJECT = 0.1f;
|
||||
@@ -543,6 +545,7 @@ void LLPipeline::cleanup()
|
||||
mInitialized = FALSE;
|
||||
|
||||
mDeferredVB = NULL;
|
||||
mCubeVB = NULL;
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
|
||||
Reference in New Issue
Block a user