Change LLViewerMedia::isInterestingEnough() to also check selection

If the object is in the selection, its interesting.  Load its media data
ASAP.

Conceptually reviewed by monroe
meow-7.2.2
Rick Pasetto 2009-12-14 17:39:24 -08:00
parent a386296855
commit c0eb697a53
3 changed files with 15 additions and 4 deletions

View File

@ -561,11 +561,22 @@ bool LLViewerMedia::getInWorldMediaDisabled()
//////////////////////////////////////////////////////////////////////////////////////////
// static
bool LLViewerMedia::isInterestingEnough(const LLUUID &object_id, const F64 &object_interest)
bool LLViewerMedia::isInterestingEnough(const LLVOVolume *object, const F64 &object_interest)
{
bool result = false;
if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == object_id)
if (NULL == object)
{
result = false;
}
// Focused? Then it is interesting!
else if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == object->getID())
{
result = true;
}
// Selected? Then it is interesting!
// XXX Sadly, 'contains()' doesn't take a const :(
else if (LLSelectMgr::getInstance()->getSelection()->contains(const_cast<LLVOVolume*>(object)))
{
result = true;
}

View File

@ -112,7 +112,7 @@ class LLViewerMedia
static void setInWorldMediaDisabled(bool disabled);
static bool getInWorldMediaDisabled();
static bool isInterestingEnough(const LLUUID& object_id, const F64 &object_interest);
static bool isInterestingEnough(const LLVOVolume* object, const F64 &object_interest);
// Returns the priority-sorted list of all media impls.
static impl_list &getPriorityList();

View File

@ -139,7 +139,7 @@ public:
}
virtual bool isInterestingEnough() const
{
return LLViewerMedia::isInterestingEnough(mObject->getID(), getMediaInterest());
return LLViewerMedia::isInterestingEnough(mObject, getMediaInterest());
}
virtual std::string getCapabilityUrl(const std::string &name) const