diff options
Diffstat (limited to 'indra/newview')
-rwxr-xr-x | indra/newview/llmediadataclient.cpp | 2 | ||||
-rw-r--r-- | indra/newview/lltoolpie.cpp | 8 | ||||
-rw-r--r-- | indra/newview/llviewermedia.cpp | 14 | ||||
-rw-r--r-- | indra/newview/llviewermedia.h | 2 | ||||
-rw-r--r-- | indra/newview/llviewermediafocus.cpp | 16 | ||||
-rw-r--r-- | indra/newview/llvovolume.cpp | 7 |
6 files changed, 38 insertions, 11 deletions
diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 2694075a58..91064eea6b 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -402,7 +402,7 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::request_queue LLMediaDataClient::request_queue_t::const_iterator end = q.end(); while (iter != end) { - s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString(); + s << "\t" << i << "]: " << (*iter)->getObject()->getID().asString() << "(" << (*iter)->getObject()->getMediaInterest() << ")"; iter++; i++; } diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp index 5ed8dc5fb9..f88de20242 100644 --- a/indra/newview/lltoolpie.cpp +++ b/indra/newview/lltoolpie.cpp @@ -1243,8 +1243,6 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) return false; } - - // Does this face have media? const LLTextureEntry* tep = objectp->getTE(pick.mObjectFace); if(!tep) @@ -1257,11 +1255,11 @@ bool LLToolPie::handleMediaClick(const LLPickInfo& pick) viewer_media_t media_impl = mep ? LLViewerMedia::getMediaImplFromTextureID(mep->getMediaID()) : NULL; - if (gSavedSettings.getBOOL("MediaOnAPrimUI") - && media_impl.notNull()) + if (gSavedSettings.getBOOL("MediaOnAPrimUI")) { - if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) ) + if (!LLViewerMediaFocus::getInstance()->isFocusedOnFace(pick.getObject(), pick.mObjectFace) || media_impl.isNull()) { + // It's okay to give this a null impl LLViewerMediaFocus::getInstance()->setFocusFace(pick.getObject(), pick.mObjectFace, media_impl, pick.mNormal); } else diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 57e4ed0c1e..7c5b360b92 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -558,6 +558,20 @@ bool LLViewerMedia::getInWorldMediaDisabled() return sInWorldMediaDisabled; } +////////////////////////////////////////////////////////////////////////////////////////// +// static +bool LLViewerMedia::isInterestingEnough(const LLUUID &object_id, const F64 &object_interest) +{ + if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == object_id) + { + return true; + } + else { + // XXX HACK + return object_interest > 1023;// INTEREST_THRESHHOLD; + } +} + LLViewerMedia::impl_list &LLViewerMedia::getPriorityList() { return sViewerMediaImplList; diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 349a66867a..26b822aba6 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -112,6 +112,8 @@ class LLViewerMedia static void setInWorldMediaDisabled(bool disabled); static bool getInWorldMediaDisabled(); + static bool isInterestingEnough(const LLUUID& object_id, const F64 &object_interest); + // Returns the priority-sorted list of all media impls. static impl_list &getPriorityList(); diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index f639c841e7..e04a54fbd6 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -144,9 +144,19 @@ void LLViewerMediaFocus::setFocusFace(LLPointer<LLViewerObject> objectp, S32 fac } mFocusedImplID = LLUUID::null; - mFocusedObjectID = LLUUID::null; - mFocusedObjectFace = 0; + if (objectp.notNull()) + { + // Still record the focused object...it may mean we need to load media data. + // This will aid us in determining this object is "important enough" + mFocusedObjectID = objectp->getID(); + mFocusedObjectFace = face; + } + else { + mFocusedObjectID = LLUUID::null; + mFocusedObjectFace = 0; + } } + } void LLViewerMediaFocus::clearFocus() @@ -336,7 +346,7 @@ BOOL LLViewerMediaFocus::handleScrollWheel(S32 x, S32 y, S32 clicks) void LLViewerMediaFocus::update() { - if(mFocusedImplID.notNull() || mFocusedObjectID.notNull()) + if(mFocusedImplID.notNull()) { // We have a focused impl/face. if(!getFocus()) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 08e12f4ad9..801bd90423 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -68,6 +68,7 @@ #include "llmediaentry.h" #include "llmediadataclient.h" #include "llagent.h" +#include "llviewermediafocus.h" const S32 MIN_QUIET_FRAMES_COALESCE = 30; const F32 FORCE_SIMPLE_RENDER_AREA = 512.f; @@ -138,8 +139,7 @@ public: } virtual bool isInterestingEnough() const { - // TODO: use performance manager to control this - return true; + return LLViewerMedia::isInterestingEnough(mObject->getID(), getMediaInterest()); } virtual std::string getCapabilityUrl(const std::string &name) const @@ -2089,6 +2089,9 @@ viewer_media_t LLVOVolume::getMediaImpl(U8 face_id) const F64 LLVOVolume::getTotalMediaInterest() const { + if (LLViewerMediaFocus::getInstance()->getFocusedObjectID() == getID()) + return F64_MAX; + F64 interest = (F64)-1.0; // means not interested; int i = 0; const int end = getNumTEs(); |