diff options
author | Monroe Williams <monroe@lindenlab.com> | 2009-10-01 02:35:53 +0000 |
---|---|---|
committer | Monroe Williams <monroe@lindenlab.com> | 2009-10-01 02:35:53 +0000 |
commit | cf9239cabcf7999a2d2393bd4bdb6fc08e27c09c (patch) | |
tree | b366355f955b7bf55197ef6caa105881da88df32 /indra/newview/llviewermediafocus.cpp | |
parent | 8135ddac021d3ea1aba2100f862bdb58eff33d07 (diff) |
svn merge -r 134922:134973 svn+ssh://svn.lindenlab.com/svn/linden/branches/media-on-a-prim/moap-7
Merging branches/media-on-a-prim/moap-7 down to viewer-2.0.
Diffstat (limited to 'indra/newview/llviewermediafocus.cpp')
-rw-r--r-- | indra/newview/llviewermediafocus.cpp | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index e7576d5c76..f9377ab37b 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -47,6 +47,7 @@ #include "llparcel.h" #include "llviewerparcelmgr.h" #include "llweb.h" +#include "llmediaentry.h" // // LLViewerMediaFocus // @@ -91,14 +92,38 @@ void LLViewerMediaFocus::cleanupClass() void LLViewerMediaFocus::setFocusFace( BOOL b, LLPointer<LLViewerObject> objectp, S32 face, viewer_media_t media_impl ) { LLParcel *parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); + + if(mMediaImpl.notNull()) + { + mMediaImpl->focus(false); + } + if (b && media_impl.notNull()) { + bool face_auto_zoom = false; mMediaImpl = media_impl; + mMediaImpl->focus(true); + LLSelectMgr::getInstance()->deselectAll(); LLSelectMgr::getInstance()->selectObjectOnly(objectp, face); + if(objectp.notNull()) + { + LLTextureEntry* tep = objectp->getTE(face); + if(! tep->hasMedia()) + { + // Error condition + } + LLMediaEntry* mep = tep->getMediaData(); + face_auto_zoom = mep->getAutoZoom(); + if(! mep->getAutoPlay()) + { + std::string url = mep->getCurrentURL().empty() ? mep->getHomeURL() : mep->getCurrentURL(); + media_impl->navigateTo(url, "", true); + } + } mFocus = LLSelectMgr::getInstance()->getSelection(); - if(mMediaHUD.get() && ! parcel->getMediaPreventCameraZoom()) + if(mMediaHUD.get() && face_auto_zoom && ! parcel->getMediaPreventCameraZoom()) { mMediaHUD.get()->resetZoomLevel(); mMediaHUD.get()->nextZoomLevel(); @@ -108,6 +133,7 @@ void LLViewerMediaFocus::setFocusFace( BOOL b, LLPointer<LLViewerObject> objectp gFocusMgr.setKeyboardFocus(this); } mObjectID = objectp->getID(); + mObjectFace = face; // LLViewerMedia::addObserver(this, mObjectID); @@ -133,6 +159,8 @@ void LLViewerMediaFocus::setFocusFace( BOOL b, LLPointer<LLViewerObject> objectp // and null out the media impl mMediaImpl = NULL; + mObjectID = LLUUID::null; + mObjectFace = 0; } if(mMediaHUD.get()) { @@ -230,6 +258,12 @@ void LLViewerMediaFocus::setMouseOverFlag(bool b, viewer_media_t media_impl) gHUDView->addChild(media_hud); } mMediaHUD.get()->setMediaImpl(media_impl); + + if(mMediaImpl.notNull() && (mMediaImpl != media_impl)) + { + mMediaImpl->focus(false); + } + mMediaImpl = media_impl; } mMouseOverFlag = b; @@ -356,3 +390,8 @@ F32 LLViewerMediaFocus::getBBoxAspectRatio(const LLBBox& bbox, const LLVector3& // Return the aspect ratio. return *width / *height; } + +bool LLViewerMediaFocus::isFocusedOnFace(LLPointer<LLViewerObject> objectp, S32 face) +{ + return objectp->getID() == mObjectID && face == mObjectFace; +} |