summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMonroe Linden <monroe@lindenlab.com>2009-10-30 14:52:33 -0700
committerMonroe Linden <monroe@lindenlab.com>2009-10-30 14:52:33 -0700
commit1fbacbaa9ac002f7f5ae9a0a18ef985a8ec934c7 (patch)
tree48e043ed9b995cf76df76f56c0040d2d41e31be1
parentd6363c6c7ad32ecd12ca0bae849505a6181fb9e2 (diff)
Partial implementation of LLFloaterNearbyMedia::refreshList(), with many TODO sections and a bit of ifdef-ed out pseudocode.
Initial pass at LLViewerMediaImpl::getProximity(). Currently it just returns the position in the priority list, but that will change.
-rw-r--r--indra/newview/llviewermedia.cpp15
-rw-r--r--indra/newview/llviewermedia.h2
2 files changed, 17 insertions, 0 deletions
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index f9e09036a8..249b55d2ab 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -512,6 +512,7 @@ void LLViewerMedia::updateMedia()
int impl_count_total = 0;
int impl_count_interest_low = 0;
int impl_count_interest_normal = 0;
+ int i = 0;
#if 0
LL_DEBUGS("PluginPriority") << "Sorted impls:" << llendl;
@@ -602,6 +603,17 @@ void LLViewerMedia::updateMedia()
}
pimpl->setPriority(new_priority);
+
+ if(!pimpl->getUsedInUI())
+ {
+ // Any impls used in the UI should not be in the proximity list.
+ pimpl->mProximity = -1;
+ }
+ else
+ {
+ // Other impls just get the same ordering as the priority list (for now).
+ pimpl->mProximity = i;
+ }
#if 0
LL_DEBUGS("PluginPriority") << " " << pimpl
@@ -614,6 +626,8 @@ void LLViewerMedia::updateMedia()
#endif
total_cpu += pimpl->getCPUUsage();
+
+ i++;
}
LL_DEBUGS("PluginPriority") << "Total reported CPU usage is " << total_cpu << llendl;
@@ -661,6 +675,7 @@ LLViewerMediaImpl::LLViewerMediaImpl( const LLUUID& texture_id,
mPreviousMediaState(MEDIA_NONE),
mPreviousMediaTime(0.0f),
mIsDisabled(false),
+ mProximity(-1),
mIsUpdated(false)
{
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index 1a4d2cd3c6..ee7f84b4cd 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -257,6 +257,7 @@ public:
void calculateInterest();
F64 getInterest() const { return mInterest; };
F64 getApproximateTextureInterest();
+ S32 getProximity() { return mProximity; };
// Mark this object as being used in a UI panel instead of on a prim
// This will be used as part of the interest sorting algorithm.
@@ -321,6 +322,7 @@ public:
int mPreviousMediaState;
F64 mPreviousMediaTime;
bool mIsDisabled;
+ S32 mProximity;
private:
BOOL mIsUpdated ;