From 8f3c1af82d8a8a1d1334feac5dd83ae687ceee01 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 10 Jul 2013 02:15:47 -0500 Subject: [PATCH 1/3] Fixed textentry combobox arrow positioning issues. --- indra/llui/llcombobox.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/indra/llui/llcombobox.cpp b/indra/llui/llcombobox.cpp index 6fd7084df..46ba4d93e 100644 --- a/indra/llui/llcombobox.cpp +++ b/indra/llui/llcombobox.cpp @@ -94,10 +94,6 @@ LLComboBox::LLComboBox( const std::string& name, const LLRect &rect, const std:: mButton->setFont(LLFontGL::getFontSansSerifSmall()); mButton->setFollows(FOLLOWS_LEFT | FOLLOWS_BOTTOM | FOLLOWS_RIGHT); mButton->setHAlign( LLFontGL::LEFT ); - if(mAllowTextEntry) - { - mButton->setRightHPad(2); - } addChild(mButton); @@ -931,6 +927,11 @@ BOOL LLComboBox::handleUnicodeCharHere(llwchar uni_char) void LLComboBox::setAllowTextEntry(BOOL allow, S32 max_chars, BOOL set_tentative) { mAllowTextEntry = allow; + if(allow) + mButton->setRightHPad(2); + else + mButton->setRightHPad(LLBUTTON_H_PAD); + mTextEntryTentative = set_tentative; mMaxChars = max_chars; From 6be6f488ba500fde5706099ccf4e1cfc6473f7fe Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 11 Jul 2013 20:53:12 -0500 Subject: [PATCH 2/3] Added setting to toggle autoplaying of prim media, independent of parcel media. Audio autoplay also now yieds to sounds being stopped via nearby media panel. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ indra/newview/llpanelnearbymedia.cpp | 17 ++++++++++++----- indra/newview/llpanelnearbymedia.h | 5 +++++ indra/newview/llviewermedia.cpp | 19 +++++++++++++++---- indra/newview/llviewermedia.h | 1 + indra/newview/llviewermediafocus.cpp | 2 +- indra/newview/llviewerparcelmgr.cpp | 17 ++++++++++++++++- .../xui/en-us/panel_preferences_audio.xml | 13 +++++++------ 8 files changed, 68 insertions(+), 17 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 95f2971b9..ae097df9c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10432,6 +10432,17 @@ This should be as low as possible, but too low may break functionality Value 0 + PrimMediaAutoPlayEnable + + Comment + Auto play prim media when available + Persist + 1 + Type + Boolean + Value + 0 + PerAccountSettingsFile Comment diff --git a/indra/newview/llpanelnearbymedia.cpp b/indra/newview/llpanelnearbymedia.cpp index 9438dfa79..e2856ae1f 100644 --- a/indra/newview/llpanelnearbymedia.cpp +++ b/indra/newview/llpanelnearbymedia.cpp @@ -84,10 +84,11 @@ LLPanelNearByMedia::LLPanelNearByMedia(bool standalone_panel) { mHoverTimer.stop(); - mParcelAudioAutoStart = gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) && - gSavedSettings.getBOOL("MediaTentativeAutoPlay"); + mParcelAudioAutoStart = gSavedSettings.getBOOL("MediaTentativeAutoPlay"); + /*gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) && + gSavedSettings.getBOOL("MediaTentativeAutoPlay");*/ - gSavedSettings.getControl(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)->getSignal()->connect(boost::bind(&LLPanelNearByMedia::handleMediaAutoPlayChanged, this, _2)); + //gSavedSettings.getControl(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING)->getSignal()->connect(boost::bind(&LLPanelNearByMedia::handleMediaAutoPlayChanged, this, _2)); mCommitCallbackRegistrar.add("MediaListCtrl.EnableAll", boost::bind(&LLPanelNearByMedia::onClickEnableAll, this)); mCommitCallbackRegistrar.add("MediaListCtrl.DisableAll", boost::bind(&LLPanelNearByMedia::onClickDisableAll, this)); @@ -909,7 +910,7 @@ void LLPanelNearByMedia::onClickParcelAudioPlay() } else { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + LLViewerParcelMedia::playStreamingMusic(LLViewerParcelMgr::getInstance()->getAgentParcel()); } } @@ -1263,12 +1264,18 @@ void* createNearbyMediaPanel(void* userdata) return new LLPanelNearByMedia(false); } -LLFloaterNearbyMedia::LLFloaterNearbyMedia() +LLFloaterNearbyMedia::LLFloaterNearbyMedia() : mPanel(NULL) { mFactoryMap["nearby_media"] = LLCallbackMap(createNearbyMediaPanel, this); LLUICtrlFactory::getInstance()->buildFloater(this,"floater_nearby_media.xml",&mFactoryMap,false); } +/*virtual*/ BOOL LLFloaterNearbyMedia::postBuild() +{ + mPanel = getChild("nearby_media",false,false); + return LLFloater::postBuild(); +} + // static void LLFloaterNearbyMedia::updateClass() { diff --git a/indra/newview/llpanelnearbymedia.h b/indra/newview/llpanelnearbymedia.h index e6d0a4d9b..410dfb48c 100644 --- a/indra/newview/llpanelnearbymedia.h +++ b/indra/newview/llpanelnearbymedia.h @@ -189,10 +189,15 @@ public: static void updateClass(); + /*virtual*/ BOOL postBuild(); /*virtual*/ void onClose(bool app_quitting); /*virtual*/ void onOpen(); virtual void handleReshape(const LLRect& new_rect, bool by_user); + + LLPanelNearByMedia* getMediaPanel() { return mPanel; } +private: + LLPanelNearByMedia* mPanel; }; #endif // LL_LLPANELNEARBYMEDIA_H diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index ee4162dce..0072b68fc 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -87,6 +87,7 @@ std::string getProfileURL(const std::string& agent_name); /*static*/ const char* LLViewerMedia::AUTO_PLAY_MEDIA_SETTING = "ParcelMediaAutoPlayEnable"; +/*static*/ const char* LLViewerMedia::AUTO_PLAY_PRIM_MEDIA_SETTING = "PrimMediaAutoPlayEnable"; /*static*/ const char* LLViewerMedia::SHOW_MEDIA_ON_OTHERS_SETTING = "MediaShowOnOthers"; /*static*/ const char* LLViewerMedia::SHOW_MEDIA_WITHIN_PARCEL_SETTING = "MediaShowWithinParcel"; /*static*/ const char* LLViewerMedia::SHOW_MEDIA_OUTSIDE_PARCEL_SETTING = "MediaShowOutsideParcel"; @@ -1103,7 +1104,7 @@ void LLViewerMedia::setAllMediaEnabled(bool val) } else { - gAudiop->startInternetStream(LLViewerMedia::getParcelAudioURL()); + LLViewerParcelMedia::playStreamingMusic(LLViewerParcelMgr::getInstance()->getAgentParcel()); } } } @@ -3857,9 +3858,19 @@ void LLViewerMediaImpl::setTextureID(LLUUID id) // bool LLViewerMediaImpl::isAutoPlayable() const { - return (mMediaAutoPlay && - gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) && - gSavedSettings.getBOOL("MediaTentativeAutoPlay")); + static const LLCachedControl media_tentative_auto_play("MediaTentativeAutoPlay",false); + static const LLCachedControl auto_play_parcel_media(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING,false); + static const LLCachedControl auto_play_prim_media(LLViewerMedia::AUTO_PLAY_PRIM_MEDIA_SETTING,false); + if(mMediaAutoPlay && media_tentative_auto_play) + { + if(getUsedInUI()) + return true; + else if(isParcelMedia() && auto_play_parcel_media) + return true; + else if(auto_play_prim_media) + return true; + } + return false; } ////////////////////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index 8be43590c..902d7ae0f 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -84,6 +84,7 @@ public: // String to get/set media autoplay in gSavedSettings static const char* AUTO_PLAY_MEDIA_SETTING; + static const char* AUTO_PLAY_PRIM_MEDIA_SETTING; static const char* SHOW_MEDIA_ON_OTHERS_SETTING; static const char* SHOW_MEDIA_WITHIN_PARCEL_SETTING; static const char* SHOW_MEDIA_OUTSIDE_PARCEL_SETTING; diff --git a/indra/newview/llviewermediafocus.cpp b/indra/newview/llviewermediafocus.cpp index 701d4981b..91a2dfafc 100644 --- a/indra/newview/llviewermediafocus.cpp +++ b/indra/newview/llviewermediafocus.cpp @@ -414,7 +414,7 @@ void LLViewerMediaFocus::update() normal = mHoverObjectNormal; } - if(media_impl && viewer_object) + if(media_impl && viewer_object && !media_impl->isForcedUnloaded()) { // We have an object and impl to point at. diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp index 2a42b7661..5b7c7f274 100644 --- a/indra/newview/llviewerparcelmgr.cpp +++ b/indra/newview/llviewerparcelmgr.cpp @@ -55,6 +55,7 @@ #include "llfloaterbuyland.h" #include "llfloatergroups.h" //#include "llfloaterhtml.h" +#include "llpanelnearbymedia.h" #include "llfloatersellland.h" #include "llfloaterteleporthistory.h" #include "llfloatertools.h" @@ -1799,6 +1800,9 @@ void optionally_start_music(LLParcel* parcel) { if (gSavedSettings.getBOOL("AudioStreamingMusic")) { + + + // Make the user click the start button on the overlay bar. JC // llinfos << "Starting parcel music " << parcel->getMusicURL() << llendl; @@ -1806,8 +1810,19 @@ void optionally_start_music(LLParcel* parcel) // changed as part of SL-4878 if (gOverlayBar && gOverlayBar->musicPlaying()) { - LLViewerParcelMedia::playStreamingMusic(parcel); + LLPanelNearByMedia* nearby_media_panel = LLFloaterNearbyMedia::instanceExists() ? LLFloaterNearbyMedia::getInstance()->getMediaPanel() : NULL; + if ((nearby_media_panel && + nearby_media_panel->getParcelAudioAutoStart()) || + // or they have expressed no opinion in the UI, but have autoplay on... + (!nearby_media_panel && + /*gSavedSettings.getBOOL(LLViewerMedia::AUTO_PLAY_MEDIA_SETTING) &&*/ + gSavedSettings.getBOOL("MediaTentativeAutoPlay"))) + { + LLViewerParcelMedia::playStreamingMusic(parcel); + return; + } } + gAudiop->startInternetStream(LLStringUtil::null); } } diff --git a/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml b/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml index 727e05255..3f77ee5e2 100644 --- a/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml +++ b/indra/newview/skins/default/xui/en-us/panel_preferences_audio.xml @@ -1,13 +1,14 @@ Volume: - Streaming Preferences: - Audio Preferences: - - + Streaming Preferences: + Audio Preferences: + + + - - + + From ccff8475c1637c15f7351a9553f37b552f9d5d80 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 11 Jul 2013 20:54:04 -0500 Subject: [PATCH 3/3] Mesh vertex corruption fix taken from LL upstream. --- indra/newview/lldrawpoolavatar.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp index 636a9b585..61762272d 100644 --- a/indra/newview/lldrawpoolavatar.cpp +++ b/indra/newview/lldrawpoolavatar.cpp @@ -140,6 +140,17 @@ void LLDrawPoolAvatar::prerender() { sBufferUsage = GL_STREAM_DRAW_ARB; } + + if (!mDrawFace.empty()) + { + + const LLFace *facep = mDrawFace[0]; + if (facep && facep->getDrawable()) + { + LLVOAvatar* avatarp = (LLVOAvatar *)facep->getDrawable()->getVObj().get(); + updateRiggedVertexBuffers(avatarp); + } + } } LLMatrix4& LLDrawPoolAvatar::getModelView() @@ -1546,7 +1557,6 @@ void LLDrawPoolAvatar::renderRigged(LLVOAvatar* avatar, U32 type, bool glow) void LLDrawPoolAvatar::renderDeferredRiggedSimple(LLVOAvatar* avatar) { - updateRiggedVertexBuffers(avatar); renderRigged(avatar, RIGGED_DEFERRED_SIMPLE); } @@ -1610,7 +1620,6 @@ void LLDrawPoolAvatar::updateRiggedVertexBuffers(LLVOAvatar* avatar) void LLDrawPoolAvatar::renderRiggedSimple(LLVOAvatar* avatar) { - updateRiggedVertexBuffers(avatar); renderRigged(avatar, RIGGED_SIMPLE); }