summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Pasetto <rick@lindenlab.com>2010-02-10 17:31:46 -0800
committerRick Pasetto <rick@lindenlab.com>2010-02-10 17:31:46 -0800
commit234f5a48a70d92e00aded1003814b2b883fa5ef4 (patch)
treecb8f7e8947cb6182cd37cf5c72a0fecc219873b7
parentc680368e19f5be7265e2f15a1f4b626b1600e773 (diff)
Code review feedback: add comments, move teleport hook to a callback in llviewermedia
Review #100
-rw-r--r--indra/newview/llagent.cpp5
-rw-r--r--indra/newview/llviewermedia.cpp18
-rw-r--r--indra/newview/llviewermedia.h4
3 files changed, 20 insertions, 7 deletions
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index f1eb942b52..2354323a66 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -5981,11 +5981,6 @@ bool LLAgent::teleportCore(bool is_local)
// This was breaking the case of teleporting within a single sim. Backing it out for now.
// gVoiceClient->leaveChannel();
- // Clear the "tentative" autoplay flag (i.e. set it to true)
- // XXX: Do we also want to re-enable all media, because we might teleport
- // somewhere where that media would still exist?
- gSavedSettings.setBOOL("MediaTentativeAutoPlay", true);
-
return true;
}
diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp
index c4f2f0eed7..1b6236ce4a 100644
--- a/indra/newview/llviewermedia.cpp
+++ b/indra/newview/llviewermedia.cpp
@@ -262,6 +262,7 @@ static const F32 LLVIEWERMEDIA_CREATE_DELAY = 1.0f;
static F32 sGlobalVolume = 1.0f;
static F64 sLowestLoadableImplInterest = 0.0f;
static bool sAnyMediaShowing = false;
+static boost::signals2::connection sTeleportFinishConnection;
//////////////////////////////////////////////////////////////////////////////////////////
static void add_media_impl(LLViewerMediaImpl* media)
@@ -863,6 +864,10 @@ void LLViewerMedia::updateMedia(void *dummy_arg)
total_cpu += pimpl->getCPUUsage();
+ // Only set sAnyMedia​Showing if it isn't used in the UI. If it isn't
+ // parcel media, do the normal "hasMedia()" check. If it is parcel media,
+ // hasMedia() seems to always be true, so we do some other checks to see
+ // if there actually is parcel media showing
if (!pimpl->getUsedInUI())
{
if (! pimpl->isParcelMedia())
@@ -951,7 +956,9 @@ void LLViewerMedia::setAllMediaEnabled(bool val)
// static
void LLViewerMedia::initClass()
{
- gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL);
+ gIdleCallbacks.addFunction(LLViewerMedia::updateMedia, NULL);
+ sTeleportFinishConnection = LLViewerParcelMgr::getInstance()->
+ setTeleportFinishedCallback(boost::bind(&LLViewerMedia::onTeleportFinished));
}
//////////////////////////////////////////////////////////////////////////////////////////
@@ -959,6 +966,15 @@ void LLViewerMedia::initClass()
void LLViewerMedia::cleanupClass()
{
gIdleCallbacks.deleteFunction(LLViewerMedia::updateMedia, NULL);
+ sTeleportFinishConnection.disconnect();
+}
+
+//////////////////////////////////////////////////////////////////////////////////////////
+// static
+void LLViewerMedia::onTeleportFinished()
+{
+ // On teleport, clear this setting (i.e. set it to true)
+ gSavedSettings.setBOOL("MediaTentativeAutoPlay", true);
}
//////////////////////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h
index c9e9017e5a..b90f64adc0 100644
--- a/indra/newview/llviewermedia.h
+++ b/indra/newview/llviewermedia.h
@@ -124,7 +124,9 @@ class LLViewerMedia
// This is the comparitor used to sort the list.
static bool priorityComparitor(const LLViewerMediaImpl* i1, const LLViewerMediaImpl* i2);
-
+
+ private:
+ static void onTeleportFinished();
};
// Implementation functions not exported into header file