diff options
author | Rick Pasetto <rick@lindenlab.com> | 2009-12-14 12:03:44 -0800 |
---|---|---|
committer | Rick Pasetto <rick@lindenlab.com> | 2009-12-14 12:03:44 -0800 |
commit | da3ca7c5b9ce3493e99aa261a075dbc2ca16b5c9 (patch) | |
tree | 372137dfec61d712b223d7ded0a9ddbb0db7472c /indra/newview | |
parent | 5e4d7ec715f496406644d52701cbabc2935fc1c3 (diff) |
Allow selection of media faces even if there is no impl. We record
the target object and use that fact to raise its interest level.
This is mostly a pass-off for monroe to take and run with
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 b92d024ac9..822fcf1e7e 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(); |