예제 #1
0
		virtual bool apply(LLViewerObject* objectp)
		{
			objectp->boostTexturePriority();
			return true;
		}
예제 #2
0
void LLViewerObjectList::updateApparentAngles(LLAgent &agent)
{
	S32 i;
	S32 num_objects = 0;
	LLViewerObject *objectp;

	S32 num_updates, max_value;
	if (NUM_BINS - 1 == mCurBin)
	{
		num_updates = mObjects.count() - mCurLazyUpdateIndex;
		max_value = mObjects.count();
		gImageList.setUpdateStats(TRUE);
	}
	else
	{
		num_updates = (mObjects.count() / NUM_BINS) + 1;
		max_value = llmin(mObjects.count(), mCurLazyUpdateIndex + num_updates);
	}


	if (!gNoRender)
	{
		// Slam priorities for textures that we care about (hovered, selected, and focused)
		// Hovered
		// Assumes only one level deep of parenting
		objectp = gHoverView->getLastHoverObject();
		if (objectp)
		{
			objectp->boostTexturePriority();
		}
	}

	// Focused
	objectp = gAgent.getFocusObject();
	if (objectp)
	{
		objectp->boostTexturePriority();
	}

	// Selected
	struct f : public LLSelectedObjectFunctor
	{
		virtual bool apply(LLViewerObject* objectp)
		{
			objectp->boostTexturePriority();
			return true;
		}
	} func;
	gSelectMgr->getSelection()->applyToRootObjects(&func);

	// Iterate through some of the objects and lazy update their texture priorities
	for (i = mCurLazyUpdateIndex; i < max_value; i++)
	{
		objectp = mObjects[i];
		if (!objectp->isDead())
		{
			num_objects++;

			//  Update distance & gpw 
			objectp->setPixelAreaAndAngle(agent); // Also sets the approx. pixel area
			objectp->updateTextures(agent);	// Update the image levels of textures for this object.
		}
	}

	mCurLazyUpdateIndex = max_value;
	if (mCurLazyUpdateIndex == mObjects.count())
	{
		mCurLazyUpdateIndex = 0;
	}

	mCurBin = (++mCurBin) % NUM_BINS;

	LLVOAvatar::cullAvatarsByPixelArea();
}