diff options
Diffstat (limited to 'indra')
70 files changed, 797 insertions, 425 deletions
diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 3bb759d458..ce2b51cea2 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -291,10 +291,6 @@ LLAvatarAppearance::~LLAvatarAppearance() clearSkeleton(); deleteAndClearArray(mCollisionVolumes); - deleteAndClear(mTexSkinColor); - deleteAndClear(mTexHairColor); - deleteAndClear(mTexEyeColor); - std::for_each(mPolyMeshes.begin(), mPolyMeshes.end(), DeletePairedPointer()); mPolyMeshes.clear(); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0ac30b4d63..b481cf7095 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -2196,7 +2196,15 @@ void LLRender::texCoord2fv(const GLfloat* tc) void LLRender::color4ub(const GLubyte& r, const GLubyte& g, const GLubyte& b, const GLubyte& a) { - mColorsp[mCount] = LLColor4U(r,g,b,a); + if (!LLGLSLShader::sCurBoundShaderPtr || + LLGLSLShader::sCurBoundShaderPtr->mAttributeMask & LLVertexBuffer::MAP_COLOR) + { + mColorsp[mCount] = LLColor4U(r,g,b,a); + } + else + { //not using shaders or shader reads color from a uniform + diffuseColor4ub(r,g,b,a); + } } void LLRender::color4ubv(const GLubyte* c) { diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index 6e6bcd6ab5..c1f8a077b5 100755 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -2742,8 +2742,6 @@ void LLFloaterView::refresh() } } -const S32 FLOATER_MIN_VISIBLE_PIXELS = 16; - void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_outside, BOOL snap_in_toolbars/* = false*/) { if (floater->getParent() != this) @@ -2796,11 +2794,32 @@ void LLFloaterView::adjustToFitScreen(LLFloater* floater, BOOL allow_partial_out } } + const LLRect& left_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_LEFT]; + const LLRect& bottom_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_BOTTOM]; + const LLRect& right_toolbar_rect = mToolbarRects[LLToolBarEnums::TOOLBAR_RIGHT]; + const LLRect& floater_rect = floater->getRect(); + + S32 delta_left = left_toolbar_rect.notEmpty() ? left_toolbar_rect.mRight - floater_rect.mRight : 0; + S32 delta_bottom = bottom_toolbar_rect.notEmpty() ? bottom_toolbar_rect.mTop - floater_rect.mTop : 0; + S32 delta_right = right_toolbar_rect.notEmpty() ? right_toolbar_rect.mLeft - floater_rect.mLeft : 0; + // move window fully onscreen if (floater->translateIntoRect( snap_in_toolbars ? getSnapRect() : gFloaterView->getRect(), allow_partial_outside ? FLOATER_MIN_VISIBLE_PIXELS : S32_MAX )) { floater->clearSnapTarget(); } + else if (delta_left > 0 && floater_rect.mTop < left_toolbar_rect.mTop && floater_rect.mBottom > left_toolbar_rect.mBottom) + { + floater->translate(delta_left, 0); + } + else if (delta_bottom > 0 && floater_rect.mLeft > bottom_toolbar_rect.mLeft && floater_rect.mRight < bottom_toolbar_rect.mRight) + { + floater->translate(0, delta_bottom); + } + else if (delta_right < 0 && floater_rect.mTop < right_toolbar_rect.mTop && floater_rect.mBottom > right_toolbar_rect.mBottom) + { + floater->translate(delta_right, 0); + } } void LLFloaterView::draw() @@ -3000,6 +3019,14 @@ void LLFloaterView::popVisibleAll(const skip_list_t& skip_list) LLFloaterReg::blockShowFloaters(false); } +void LLFloaterView::setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect) +{ + if (tb < LLToolBarEnums::TOOLBAR_COUNT) + { + mToolbarRects[tb] = toolbar_rect; + } +} + void LLFloater::setInstanceName(const std::string& name) { if (name != mInstanceName) diff --git a/indra/llui/llfloater.h b/indra/llui/llfloater.h index 75715ef296..ccaae1d02b 100755 --- a/indra/llui/llfloater.h +++ b/indra/llui/llfloater.h @@ -32,6 +32,7 @@ #define LL_FLOATER_H #include "llpanel.h" +#include "lltoolbar.h" #include "lluuid.h" //#include "llnotificationsutil.h" #include <set> @@ -514,6 +515,8 @@ private: // LLFloaterView // Parent of all floating panels +const S32 FLOATER_MIN_VISIBLE_PIXELS = 16; + class LLFloaterView : public LLUICtrl { public: @@ -572,10 +575,13 @@ public: void setFloaterSnapView(LLHandle<LLView> snap_view) {mSnapView = snap_view; } LLFloater* getFrontmostClosableFloater(); + void setToolbarRect(LLToolBarEnums::EToolBarLocation tb, const LLRect& toolbar_rect); + private: void hiddenFloaterClosed(LLFloater* floater); LLRect mLastSnapRect; + LLRect mToolbarRects[LLToolBarEnums::TOOLBAR_COUNT]; LLHandle<LLView> mSnapView; BOOL mFocusCycleMode; S32 mSnapOffsetBottom; diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 6e03f604a2..594e1e150b 100755 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1855,7 +1855,7 @@ void LLScrollListCtrl::showNameDetails(std::string id, bool is_group) // open the resident's details or the group details std::string sltype = is_group ? "group" : "agent"; std::string slurl = "secondlife:///app/" + sltype + "/" + id + "/about"; - LLUrlAction::clickAction(slurl); + LLUrlAction::clickAction(slurl, true); } void LLScrollListCtrl::copyNameToClipboard(std::string id, bool is_group) diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp index 5ec4cf4fe5..4144a42fd6 100755 --- a/indra/llui/lltextbase.cpp +++ b/indra/llui/lltextbase.cpp @@ -167,6 +167,7 @@ LLTextBase::Params::Params() max_text_length("max_length", 255), font_shadow("font_shadow"), wrap("wrap"), + trusted_content("trusted_content", true), use_ellipses("use_ellipses", false), parse_urls("parse_urls", false), parse_highlights("parse_highlights", false) @@ -211,6 +212,7 @@ LLTextBase::LLTextBase(const LLTextBase::Params &p) mLineSpacingPixels(p.line_spacing.pixels), mClip(p.clip), mClipPartial(p.clip_partial && !p.allow_scroll), + mTrustedContent(p.trusted_content), mTrackEnd( p.track_end ), mScrollIndex(-1), mSelectionStart( 0 ), @@ -3164,7 +3166,7 @@ BOOL LLNormalTextSegment::handleMouseUp(S32 x, S32 y, MASK mask) // Only process the click if it's actually in this segment, not to the right of the end-of-line. if(mEditor.getSegmentAtLocalPos(x, y, false) == this) { - LLUrlAction::clickAction(getStyle()->getLinkHREF()); + LLUrlAction::clickAction(getStyle()->getLinkHREF(), mEditor.isContentTrusted()); return TRUE; } } diff --git a/indra/llui/lltextbase.h b/indra/llui/lltextbase.h index a74e97cac8..3603f55c3f 100755 --- a/indra/llui/lltextbase.h +++ b/indra/llui/lltextbase.h @@ -291,7 +291,8 @@ public: parse_urls, parse_highlights, clip, - clip_partial; + clip_partial, + trusted_content; Optional<S32> v_pad, h_pad; @@ -361,6 +362,7 @@ public: bool getWordWrap() { return mWordWrap; } bool getUseEllipses() { return mUseEllipses; } bool truncate(); // returns true of truncation occurred + bool isContentTrusted() {return mTrustedContent;} // TODO: move into LLTextSegment? void createUrlContextMenu(S32 x, S32 y, const std::string &url); // create a popup context menu for the given Url @@ -634,6 +636,7 @@ protected: bool mBGVisible; // render background? bool mClip; // clip text to widget rect bool mClipPartial; // false if we show lines that are partially inside bounding rect + bool mTrustedContent; // if false, does not allow to execute SURL links from this editor bool mPlainText; // didn't use Image or Icon segments bool mAutoIndent; S32 mMaxTextByteLength; // Maximum length mText is allowed to be in bytes diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp index 62140dd9d6..81d9fd1ec9 100755 --- a/indra/llui/lltexteditor.cpp +++ b/indra/llui/lltexteditor.cpp @@ -1620,7 +1620,7 @@ BOOL LLTextEditor::handleControlKey(const KEY key, const MASK mask) } } - if (handled) + if (handled && !gFocusMgr.getMouseCapture()) { updatePrimary(); } diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 6bfe113933..e692d9847a 100755 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -118,7 +118,8 @@ LLToolBar::LLToolBar(const LLToolBar::Params& p) mButtonLeaveSignal(NULL), mButtonRemoveSignal(NULL), mDragAndDropTarget(false), - mCaretIcon(NULL) + mCaretIcon(NULL), + mCenterPanel(NULL) { mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_WITH_TEXT] = p.button_icon_and_text; mButtonParams[LLToolBarEnums::BTNTYPE_ICONS_ONLY] = p.button_icon; @@ -200,14 +201,15 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) center_panel_p.auto_resize = false; center_panel_p.user_resize = false; center_panel_p.mouse_opaque = false; - LLLayoutPanel* center_panel = LLUICtrlFactory::create<LLLayoutPanel>(center_panel_p); - mCenteringStack->addChild(center_panel); + mCenterPanel = LLUICtrlFactory::create<LLCenterLayoutPanel>(center_panel_p); + mCenteringStack->addChild(mCenterPanel); LLPanel::Params button_panel_p(p.button_panel); - button_panel_p.rect = center_panel->getLocalRect(); - button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; + button_panel_p.rect = mCenterPanel->getLocalRect(); + button_panel_p.follows.flags = FOLLOWS_BOTTOM|FOLLOWS_LEFT; mButtonPanel = LLUICtrlFactory::create<LLPanel>(button_panel_p); - center_panel->addChild(mButtonPanel); + mCenterPanel->setButtonPanel(mButtonPanel); + mCenterPanel->addChild(mButtonPanel); mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p)); @@ -1244,3 +1246,15 @@ const std::string LLToolBarButton::getToolTip() const return tooltip; } +void LLToolBar::LLCenterLayoutPanel::handleReshape(const LLRect& rect, bool by_user) +{ + LLLayoutPanel::handleReshape(rect, by_user); + + if (!mReshapeCallback.empty()) + { + LLRect r; + localRectToOtherView(mButtonPanel->getRect(), &r, gFloaterView); + r.stretch(FLOATER_MIN_VISIBLE_PIXELS); + mReshapeCallback(mLocationId, r); + } +} diff --git a/indra/llui/lltoolbar.h b/indra/llui/lltoolbar.h index 743951a41f..9e17eaed8b 100755 --- a/indra/llui/lltoolbar.h +++ b/indra/llui/lltoolbar.h @@ -125,6 +125,19 @@ namespace LLToolBarEnums SIDE_TOP, }; + enum EToolBarLocation + { + TOOLBAR_NONE = 0, + TOOLBAR_LEFT, + TOOLBAR_RIGHT, + TOOLBAR_BOTTOM, + + TOOLBAR_COUNT, + + TOOLBAR_FIRST = TOOLBAR_LEFT, + TOOLBAR_LAST = TOOLBAR_BOTTOM, + }; + LLLayoutStack::ELayoutOrientation getOrientation(SideType sideType); } @@ -150,6 +163,30 @@ class LLToolBar { friend class LLToolBarButton; public: + + class LLCenterLayoutPanel : public LLLayoutPanel + { + public: + typedef struct LLLayoutPanel::Params Params; + typedef boost::function<void(LLToolBarEnums::EToolBarLocation tb, const LLRect& rect)> reshape_callback_t; + + virtual ~LLCenterLayoutPanel() {} + /*virtual*/ void handleReshape(const LLRect& rect, bool by_user); + + void setLocationId(LLToolBarEnums::EToolBarLocation id) { mLocationId = id; } + void setReshapeCallback(reshape_callback_t cb) { mReshapeCallback = cb; } + void setButtonPanel(LLPanel * panel) { mButtonPanel = panel; } + + protected: + friend class LLUICtrlFactory; + LLCenterLayoutPanel(const Params& params) : LLLayoutPanel(params), mButtonPanel(NULL) {} + + private: + reshape_callback_t mReshapeCallback; + LLToolBarEnums::EToolBarLocation mLocationId; + LLPanel * mButtonPanel; + }; + struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> { Mandatory<LLToolBarEnums::ButtonType> button_display_mode; @@ -198,6 +235,7 @@ public: void setHandleDragCallback(tool_handledrag_callback_t cb) { mHandleDragItemCallback = cb; } void setHandleDropCallback(tool_handledrop_callback_t cb) { mHandleDropCallback = cb; } bool isReadOnly() const { return mReadOnly; } + LLCenterLayoutPanel * getCenterLayoutPanel() const { return mCenterPanel; } LLToolBarButton* createButton(const LLCommandId& id); @@ -270,6 +308,7 @@ private: // related widgets LLLayoutStack* mCenteringStack; + LLCenterLayoutPanel* mCenterPanel; LLPanel* mButtonPanel; LLHandle<class LLContextMenu> mPopupMenuHandle; LLHandle<class LLView> mRemoveButtonHandle; diff --git a/indra/llui/llurlaction.cpp b/indra/llui/llurlaction.cpp index 23e574cb74..12537d9dd1 100755 --- a/indra/llui/llurlaction.cpp +++ b/indra/llui/llurlaction.cpp @@ -87,14 +87,14 @@ void LLUrlAction::executeSLURL(std::string url) { if (sExecuteSLURLCallback) { - sExecuteSLURLCallback(url); + sExecuteSLURLCallback(url ,true); } } -void LLUrlAction::clickAction(std::string url) +void LLUrlAction::clickAction(std::string url, bool trusted_content) { // Try to handle as SLURL first, then http Url - if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url) ) + if ( (sExecuteSLURLCallback) && !sExecuteSLURLCallback(url, trusted_content) ) { if (sOpenURLCallback) { diff --git a/indra/llui/llurlaction.h b/indra/llui/llurlaction.h index e731376b95..5f3626490c 100755 --- a/indra/llui/llurlaction.h +++ b/indra/llui/llurlaction.h @@ -66,7 +66,7 @@ public: static void showLocationOnMap(std::string url); /// perform the appropriate action for left-clicking on a Url - static void clickAction(std::string url); + static void clickAction(std::string url, bool trusted_content); /// copy the label for a Url to the clipboard static void copyLabelToClipboard(std::string url); @@ -86,7 +86,7 @@ public: /// specify the callbacks to enable this class's functionality typedef boost::function<void (const std::string&)> url_callback_t; - typedef boost::function<bool(const std::string& url)> execute_url_callback_t; + typedef boost::function<bool(const std::string& url, bool trusted_content)> execute_url_callback_t; static void setOpenURLCallback(url_callback_t cb); static void setOpenURLInternalCallback(url_callback_t cb); diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp index b1cc502c4b..840f67968d 100755 --- a/indra/llui/llurlentry.cpp +++ b/indra/llui/llurlentry.cpp @@ -1067,7 +1067,8 @@ LLUrlEntrySLLabel::LLUrlEntrySLLabel() std::string LLUrlEntrySLLabel::getLabel(const std::string &url, const LLUrlLabelCallback &cb) { - return getLabelFromWikiLink(url); + std::string label = getLabelFromWikiLink(url); + return (!LLUrlRegistry::instance().hasUrl(label)) ? label : getUrl(url); } std::string LLUrlEntrySLLabel::getUrl(const std::string &string) const diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 1c532e957e..db9edd1e86 100755 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -1203,7 +1203,7 @@ <key>Type</key> <string>Boolean</string> <key>Value</key> - <integer>0</integer> + <integer>1</integer> </map> <key>BulkChangeShareWithGroup</key> <map> @@ -8696,7 +8696,7 @@ <key>RenderDepthOfField</key> <map> <key>Comment</key> - <string>Whether to use depth of field effect when lighting and shadows are enabled</string> + <string>Whether to use depth of field effect when Advanced Lighting Model is enabled</string> <key>Persist</key> <integer>1</integer> <key>Type</key> diff --git a/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl b/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl new file mode 100644 index 0000000000..1936e0dcaa --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/benchmarkF.glsl @@ -0,0 +1,39 @@ +/** + * @file benchmarkF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifdef DEFINE_GL_FRAGCOLOR +out vec4 frag_color; +#else +#define frag_color gl_FragColor +#endif + +uniform sampler2D diffuseMap; + +VARYING vec2 tc0; + +void main() +{ + frag_color = texture2D(diffuseMap, tc0); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl b/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl new file mode 100644 index 0000000000..7beb20ede4 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/benchmarkV.glsl @@ -0,0 +1,38 @@ +/** + * @file benchmarkV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2011, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +uniform mat4 modelview_projection_matrix; + +ATTRIBUTE vec3 position; + +VARYING vec2 tc0; + +void main() +{ + gl_Position = vec4(position, 1.0); + + tc0 = (position.xy*0.5+0.5); +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl index 67dc500493..da02534dbb 100755 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -31,12 +31,13 @@ out vec4 frag_color; uniform sampler2D tex0; -VARYING vec4 vertex_color; +uniform vec4 color; + VARYING vec2 vary_texcoord0; void main() { - float alpha = texture2D(tex0, vary_texcoord0.xy).a * vertex_color.a; + float alpha = texture2D(tex0, vary_texcoord0.xy).a * color.a; - frag_color = vec4(vertex_color.rgb, alpha); + frag_color = vec4(color.rgb, alpha); } diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl index c58f9dfdaf..f33115d78d 100755 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -26,16 +26,13 @@ uniform mat4 modelview_projection_matrix; ATTRIBUTE vec3 position; -ATTRIBUTE vec4 diffuse_color; ATTRIBUTE vec2 texcoord0; -VARYING vec4 vertex_color; VARYING vec2 vary_texcoord0; void main() { gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0); - vertex_color = diffuse_color; vary_texcoord0 = texcoord0; } diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 539d186441..9a1a74bc0c 100755 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -755,7 +755,7 @@ bool LLAppViewer::init() initLoggingAndGetLastDuration(); processMarkerFiles(); - + // // OK to write stuff to logs now, we've now crash reported if necessary // @@ -1230,8 +1230,8 @@ void LLAppViewer::checkMemory() } mMemCheckTimer.reset() ; - //update the availability of memory - LLMemory::updateMemoryInfo() ; + //update the availability of memory + LLMemory::updateMemoryInfo() ; bool is_low = LLMemory::isMemoryPoolLow() ; @@ -1761,7 +1761,7 @@ bool LLAppViewer::cleanup() gAudiop->setStreamingAudioImpl(NULL); // shut down the audio subsystem - gAudiop->shutdown(); + gAudiop->shutdown(); delete gAudiop; gAudiop = NULL; @@ -2574,9 +2574,9 @@ bool LLAppViewer::initConfiguration() { llwarns << "Failed --set " << name << ": setting name unknown." << llendl; } + } } } - } if (clp.hasOption("logevents")) { LLViewerEventRecorder::instance().setEventLoggingOn(); @@ -2584,7 +2584,7 @@ bool LLAppViewer::initConfiguration() std::string CmdLineChannel(gSavedSettings.getString("CmdLineChannel")); if(! CmdLineChannel.empty()) - { + { LLVersionInfo::resetChannel(CmdLineChannel); } @@ -2596,16 +2596,16 @@ bool LLAppViewer::initConfiguration() LLFastTimer::sLog = TRUE; LLFastTimer::sLogName = std::string("performance"); } - + std::string test_name(gSavedSettings.getString("LogMetrics")); if (! test_name.empty()) - { + { LLFastTimer::sMetricLog = TRUE ; // '--logmetrics' is specified with a named test metric argument so the data gathering is done only on that test // In the absence of argument, every metric would be gathered (makes for a rather slow run and hard to decipher report...) llinfos << "'--logmetrics' argument : " << test_name << llendl; LLFastTimer::sLogName = test_name; - } + } if (clp.hasOption("graphicslevel")) { @@ -2614,14 +2614,14 @@ bool LLAppViewer::initConfiguration() // that value for validity. U32 graphicslevel = gSavedSettings.getU32("RenderQualityPerformance"); if (LLFeatureManager::instance().isValidGraphicsLevel(graphicslevel)) - { + { // graphicslevel is valid: save it and engage it later. Capture // the requested value separately from the settings variable // because, if this is the first run, LLViewerWindow's constructor // will call LLFeatureManager::applyRecommendedSettings(), which // overwrites this settings variable! mForceGraphicsLevel = graphicslevel; - } + } } LLFastTimerView::sAnalyzePerformance = gSavedSettings.getBOOL("AnalyzePerformance"); @@ -2655,14 +2655,14 @@ bool LLAppViewer::initConfiguration() LLSLURL start_slurl; std::string CmdLineLoginLocation(gSavedSettings.getString("CmdLineLoginLocation")); if(! CmdLineLoginLocation.empty()) - { + { start_slurl = CmdLineLoginLocation; LLStartUp::setStartSLURL(start_slurl); if(start_slurl.getType() == LLSLURL::LOCATION) - { + { LLGridManager::getInstance()->setGridChoice(start_slurl.getGrid()); - } - } + } + } //RN: if we received a URL, hand it off to the existing instance. // don't call anotherInstanceRunning() when doing URL handoff, as @@ -2673,11 +2673,11 @@ bool LLAppViewer::initConfiguration() (gSavedSettings.getBOOL("SLURLPassToOtherInstance"))) { if (sendURLToOtherInstance(start_slurl.getSLURLString())) - { + { // successfully handed off URL to existing instance, exit return false; } - } + } const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) @@ -2994,26 +2994,26 @@ namespace { { LL_WARNS("UpdaterService") << "no info url supplied - defaulting to hard coded release notes pattern" << LL_ENDL; - // truncate version at the rightmost '.' - std::string version_short(data["version"]); - size_t short_length = version_short.rfind('.'); - if (short_length != std::string::npos) - { - version_short.resize(short_length); - } + // truncate version at the rightmost '.' + std::string version_short(data["version"]); + size_t short_length = version_short.rfind('.'); + if (short_length != std::string::npos) + { + version_short.resize(short_length); + } - LLUIString relnotes_url("[RELEASE_NOTES_BASE_URL][CHANNEL_URL]/[VERSION_SHORT]"); - relnotes_url.setArg("[VERSION_SHORT]", version_short); + LLUIString relnotes_url("[RELEASE_NOTES_BASE_URL][CHANNEL_URL]/[VERSION_SHORT]"); + relnotes_url.setArg("[VERSION_SHORT]", version_short); - // *TODO thread the update service's response through to this point - std::string const & channel = LLVersionInfo::getChannel(); - boost::shared_ptr<char> channel_escaped(curl_escape(channel.c_str(), channel.size()), &curl_free); + // *TODO thread the update service's response through to this point + std::string const & channel = LLVersionInfo::getChannel(); + boost::shared_ptr<char> channel_escaped(curl_escape(channel.c_str(), channel.size()), &curl_free); - relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); - relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); + relnotes_url.setArg("[CHANNEL_URL]", channel_escaped.get()); + relnotes_url.setArg("[RELEASE_NOTES_BASE_URL]", LLTrans::getString("RELEASE_NOTES_BASE_URL")); substitutions["INFO_URL"] = relnotes_url.getString(); } - + LLNotificationsUtil::add(notification_name, substitutions, LLSD(), apply_callback); } @@ -3202,7 +3202,7 @@ bool LLAppViewer::initWindow() LLFeatureManager::getInstance()->setGraphicsLevel(*mForceGraphicsLevel, false); gSavedSettings.setU32("RenderQualityPerformance", *mForceGraphicsLevel); } - + // Set this flag in case we crash while initializing GL gSavedSettings.setBOOL("RenderInitError", TRUE); gSavedSettings.saveToFile( gSavedSettings.getString("ClientSettingsFile"), TRUE ); @@ -3485,9 +3485,9 @@ void LLAppViewer::handleViewerCrash() if (gDirUtilp) { std::string crash_marker_file_name = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, - gLLErrorActivated - ? LLERROR_MARKER_FILE_NAME - : ERROR_MARKER_FILE_NAME); + gLLErrorActivated + ? LLERROR_MARKER_FILE_NAME + : ERROR_MARKER_FILE_NAME); LLAPRFile crash_marker_file ; crash_marker_file.open(crash_marker_file_name, LL_APR_WB); if (crash_marker_file.getFileHandle()) @@ -3498,7 +3498,7 @@ void LLAppViewer::handleViewerCrash() else { LL_WARNS("MarkerFile") << "Cannot create error marker file " << crash_marker_file_name << LL_ENDL; - } + } } else { @@ -3637,7 +3637,7 @@ void LLAppViewer::processMarkerFiles() } if (mSecondInstance) - { + { LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' owned by another instance" << LL_ENDL; } else if (marker_is_same_version) @@ -3651,7 +3651,7 @@ void LLAppViewer::processMarkerFiles() { LL_INFOS("MarkerFile") << "Exec marker '"<< mMarkerFileName << "' found, but versions did not match" << LL_ENDL; } - } + } else // marker did not exist... last exec (if any) did not freeze { // Create the marker file for this execution & lock it; it will be deleted on a clean exit @@ -3705,12 +3705,12 @@ void LLAppViewer::processMarkerFiles() { gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL; - } - else - { + } + else + { gLastExecEvent = LAST_EXEC_LLERROR_CRASH; LL_INFOS("MarkerFile") << "LLError marker '"<< llerror_marker_file << "' crashed, setting LastExecEvent to LLERROR_CRASH" << LL_ENDL; - } + } } else { @@ -3723,20 +3723,20 @@ void LLAppViewer::processMarkerFiles() if(LLAPRFile::isExist(error_marker_file, NULL, LL_APR_RB)) { if (markerIsSameVersion(error_marker_file)) - { + { if (gLastExecEvent == LAST_EXEC_LOGOUT_FROZE) - { + { gLastExecEvent = LAST_EXEC_LOGOUT_CRASH; LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to LOGOUT_CRASH" << LL_ENDL; - } - else - { - gLastExecEvent = LAST_EXEC_OTHER_CRASH; - LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; - } } else { + gLastExecEvent = LAST_EXEC_OTHER_CRASH; + LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' crashed, setting LastExecEvent to " << gLastExecEvent << LL_ENDL; + } + } + else + { LL_INFOS("MarkerFile") << "Error marker '"<< error_marker_file << "' marker found, but versions did not match" << LL_ENDL; } LLAPRFile::remove(error_marker_file); @@ -3748,29 +3748,29 @@ void LLAppViewer::removeMarkerFile(bool leave_logout_marker) if (!mSecondInstance) { LL_DEBUGS("MarkerFile") << (leave_logout_marker?"leave":"remove") <<" logout" << LL_ENDL; - if (mMarkerFile.getFileHandle()) - { + if (mMarkerFile.getFileHandle()) + { LL_DEBUGS("MarkerFile") << "removing exec marker '"<<mMarkerFileName<<"'"<< LL_ENDL; mMarkerFile.close() ; - LLAPRFile::remove( mMarkerFileName ); - } - else - { + LLAPRFile::remove( mMarkerFileName ); + } + else + { LL_WARNS("MarkerFile") << "marker '"<<mMarkerFileName<<"' not open"<< LL_ENDL; - } - if (!leave_logout_marker) + } + if (!leave_logout_marker) + { + if (mLogoutMarkerFile.getFileHandle()) { - if (mLogoutMarkerFile.getFileHandle()) - { LL_DEBUGS("MarkerFile") << "removing logout marker '"<<mLogoutMarkerFileName<<"'"<< LL_ENDL; - mLogoutMarkerFile.close(); - } - else - { + mLogoutMarkerFile.close(); + } + else + { LL_WARNS("MarkerFile") << "logout marker '"<<mLogoutMarkerFileName<<"' not open"<< LL_ENDL; - } - LLAPRFile::remove( mLogoutMarkerFileName ); } + LLAPRFile::remove( mLogoutMarkerFileName ); + } } else { @@ -4713,7 +4713,7 @@ void LLAppViewer::idle() if (!(logoutRequestSent() && hasSavedFinalSnapshot())) { - gObjectList.update(gAgent, *LLWorld::getInstance()); + gObjectList.update(gAgent); } } @@ -5402,7 +5402,7 @@ void LLAppViewer::handleLoginComplete() void LLAppViewer::launchUpdater() { - LLSD query_map = LLSD::emptyMap(); + LLSD query_map = LLSD::emptyMap(); query_map["os"] = gPlatform; // *TODO change userserver to be grid on both viewer and sim, since @@ -5599,7 +5599,7 @@ void LLAppViewer::metricsSend(bool enable_reporting) // Make a copy of the main stats to send into another thread. // Receiving thread takes ownership. LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStatsMain)); - + // Send a report request into 'thread1' to get the rest of the data // and provide some additional parameters while here. LLAppViewer::sTextureFetch->commandSendMetrics(caps_url, diff --git a/indra/newview/llchathistory.cpp b/indra/newview/llchathistory.cpp index ae0ac57e76..69aeec3975 100755 --- a/indra/newview/llchathistory.cpp +++ b/indra/newview/llchathistory.cpp @@ -548,6 +548,7 @@ protected: menu->setItemEnabled("Remove Friend", false); menu->setItemEnabled("Offer Teleport",false); menu->setItemEnabled("Voice Call", false); + menu->setItemEnabled("Chat History", false); menu->setItemEnabled("Invite Group", false); menu->setItemEnabled("Zoom In", false); menu->setItemEnabled("Share", false); @@ -570,9 +571,9 @@ protected: menu->setItemVisible("Zoom In", should_show_zoom && gObjectList.findObject(mAvatarID)); menu->setItemEnabled("Block Unblock", LLAvatarActions::canBlock(mAvatarID)); menu->setItemEnabled("Mute Text", LLAvatarActions::canBlock(mAvatarID)); + menu->setItemEnabled("Chat History", LLLogChat::isTranscriptExist(mAvatarID)); } - menu->setItemEnabled("Chat History", LLLogChat::isTranscriptExist(mAvatarID)); menu->setItemEnabled("Map", (LLAvatarTracker::instance().isBuddyOnline(mAvatarID) && is_agent_mappable(mAvatarID)) || gAgent.isGodlike() ); menu->buildDrawLabels(); menu->updateParent(LLMenuGL::sMenuContainer); @@ -724,6 +725,7 @@ LLChatHistory::LLChatHistory(const LLChatHistory::Params& p) editor_params.follows.flags = FOLLOWS_ALL; editor_params.enabled = false; // read only editor_params.show_context_menu = "true"; + editor_params.trusted_content = false; mEditor = LLUICtrlFactory::create<LLTextEditor>(editor_params, this); mEditor->setIsFriendCallback(LLAvatarActions::isFriend); } diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp index 82d3fe74c0..90800fee58 100644 --- a/indra/newview/llconversationview.cpp +++ b/indra/newview/llconversationview.cpp @@ -267,7 +267,6 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask ) //This node (conversation) was selected and a child (participant) was not if(result && getRoot()) { - if(getRoot()->getCurSelectedItem() == this) { LLConversationItem* item = dynamic_cast<LLConversationItem *>(getViewModelItem()); @@ -282,7 +281,6 @@ BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask ) { im_container->collapseMessagesPane(false); } - } selectConversationItem(); } diff --git a/indra/newview/llfloaterbulkpermission.cpp b/indra/newview/llfloaterbulkpermission.cpp index 76f62a7880..07bd262c00 100755 --- a/indra/newview/llfloaterbulkpermission.cpp +++ b/indra/newview/llfloaterbulkpermission.cpp @@ -82,6 +82,11 @@ BOOL LLFloaterBulkPermission::postBuild() mBulkChangeNextOwnerCopy = gSavedSettings.getBOOL("BulkChangeNextOwnerCopy"); mBulkChangeNextOwnerTransfer = gSavedSettings.getBOOL("BulkChangeNextOwnerTransfer"); + // fix invalid permissions case (in case initial settings were generated by a viewer affected by MAINT-3339) + if( !mBulkChangeNextOwnerTransfer && !mBulkChangeEveryoneCopy) + { + mBulkChangeNextOwnerTransfer = true; + } return TRUE; } diff --git a/indra/newview/llfloatertoybox.cpp b/indra/newview/llfloatertoybox.cpp index 324afe661f..a025a859e7 100755 --- a/indra/newview/llfloatertoybox.cpp +++ b/indra/newview/llfloatertoybox.cpp @@ -107,7 +107,7 @@ void LLFloaterToybox::draw() { const LLCommandId& id = *it; - const bool command_not_present = (gToolBarView->hasCommand(id) == LLToolBarView::TOOLBAR_NONE); + const bool command_not_present = (gToolBarView->hasCommand(id) == LLToolBarEnums::TOOLBAR_NONE); mToolBar->enableCommand(id, command_not_present); } @@ -175,9 +175,9 @@ void LLFloaterToybox::onToolBarButtonEnter(LLView* button) switch(command_loc) { - case LLToolBarView::TOOLBAR_BOTTOM: suffix = LLTrans::getString("Toolbar_Bottom_Tooltip"); break; - case LLToolBarView::TOOLBAR_LEFT: suffix = LLTrans::getString("Toolbar_Left_Tooltip"); break; - case LLToolBarView::TOOLBAR_RIGHT: suffix = LLTrans::getString("Toolbar_Right_Tooltip"); break; + case LLToolBarEnums::TOOLBAR_BOTTOM: suffix = LLTrans::getString("Toolbar_Bottom_Tooltip"); break; + case LLToolBarEnums::TOOLBAR_LEFT: suffix = LLTrans::getString("Toolbar_Left_Tooltip"); break; + case LLToolBarEnums::TOOLBAR_RIGHT: suffix = LLTrans::getString("Toolbar_Right_Tooltip"); break; default: break; diff --git a/indra/newview/llglsandbox.cpp b/indra/newview/llglsandbox.cpp index 60fa53f491..c4c1827266 100755 --- a/indra/newview/llglsandbox.cpp +++ b/indra/newview/llglsandbox.cpp @@ -62,6 +62,7 @@ #include "llresmgr.h" #include "pipeline.h" #include "llspatialpartition.h" +#include "llviewershadermgr.h" // Height of the yellow selection highlight posts for land const F32 PARCEL_POST_HEIGHT = 0.666f; @@ -767,7 +768,6 @@ void draw_line_cube(F32 width, const LLVector3& center) gGL.vertex3f(center.mV[VX] + width ,center.mV[VY] - width,center.mV[VZ] - width); } - void LLViewerObjectList::renderObjectBeacons() { if (mDebugBeacons.empty()) @@ -878,3 +878,134 @@ void LLViewerObjectList::renderObjectBeacons() } +void gpu_benchmark() +{ + if (!LLGLSLShader::sNoFixedFunction) + { //don't bother benchmarking the fixed function + return; + } + + //measure memory bandwidth by: + // - allocating a batch of textures and render targets + // - rendering those textures to those render targets + // - recording time taken + // - taking the median time for a given number of samples + + //resolution of textures/render targets + const U32 res = 1024; + + //number of textures + const U32 count = 32; + + //number of samples to take + const S32 samples = 64; + + LLGLSLShader::initProfile(); + + LLRenderTarget dest[count]; + U32 source[count]; + LLImageGL::generateTextures(count, source); + std::vector<F32> results; + + //build a random texture + U8 pixels[res*res*4]; + + for (U32 i = 0; i < res*res*4; ++i) + { + pixels[i] = (U8) ll_rand(255); + } + + + gGL.setColorMask(true, true); + LLGLDepthTest depth(GL_FALSE); + + for (U32 i = 0; i < count; ++i) + { //allocate render targets and textures + dest[i].allocate(res,res,GL_RGBA,false, false, LLTexUnit::TT_TEXTURE, true); + dest[i].bindTarget(); + dest[i].clear(); + dest[i].flush(); + + gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, source[i]); + LLImageGL::setManualImage(GL_TEXTURE_2D, 0, GL_RGBA, res,res,GL_RGBA, GL_UNSIGNED_BYTE, pixels); + } + + //make a dummy triangle to draw with + LLPointer<LLVertexBuffer> buff = new LLVertexBuffer(LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0, GL_STATIC_DRAW_ARB); + buff->allocateBuffer(3, 0, true); + + LLStrider<LLVector3> v; + LLStrider<LLVector2> tc; + + buff->getVertexStrider(v); + + v[0].set(-1,1,0); + v[1].set(-1,-3,0); + v[2].set(3,1,0); + buff->flush(); + + gBenchmarkProgram.bind(); + buff->setBuffer(LLVertexBuffer::MAP_VERTEX); + + //wait for any previoius GL commands to finish + glFinish(); + + for (S32 c = -1; c < samples; ++c) + { + LLTimer timer; + timer.start(); + + for (U32 i = 0; i < count; ++i) + { + dest[i].bindTarget(); + gGL.getTexUnit(0)->bindManual(LLTexUnit::TT_TEXTURE, source[i]); + buff->drawArrays(LLRender::TRIANGLES, 0, 3); + dest[i].flush(); + } + + //wait for current batch of copies to finish + glFinish(); + + F32 time = timer.getElapsedTimeF32(); + + if (c >= 0) // <-- ignore the first sample as it tends to be artificially slow + { + //store result in gigabytes per second + F32 gb = (F32) ((F64) (res*res*8*count))/(1000000000); + + F32 gbps = gb/time; + + results.push_back(gbps); + } + } + + gBenchmarkProgram.unbind(); + + LLGLSLShader::finishProfile(); + + LLImageGL::deleteTextures(count, source); + + + std::sort(results.begin(), results.end()); + + F32 gbps = results[results.size()/2]; + + llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to CPU timers" << llendl; + + F32 ms = gBenchmarkProgram.mTimeElapsed/1000000.f; + F32 seconds = ms/1000.f; + + F64 samples_drawn = res*res*count*samples; + F32 samples_sec = (samples_drawn/1000000000.0)/seconds; + gbps = samples_sec*8; + + if (gGLManager.mHasTimerQuery) + { + llinfos << "Memory bandwidth is " << llformat("%.3f", gbps) << "GB/sec according to ARB_timer_query" << llendl; + } + else + { + llinfos << "ARB_timer_query unavailable." << llendl; + } +} + diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 9ffbd1a675..70ffdc14ff 100755 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -1959,11 +1959,11 @@ LLDockControl::DocAt LLCallDialog::getDockControlPos(const std::string& toolbarB switch (toolbar_loc) { - case LLToolBarView::TOOLBAR_LEFT: + case LLToolBarEnums::TOOLBAR_LEFT: doc_at = LLDockControl::RIGHT; break; - case LLToolBarView::TOOLBAR_RIGHT: + case LLToolBarEnums::TOOLBAR_RIGHT: doc_at = LLDockControl::LEFT; break; } diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 3c6974cf6d..15463e0d33 100755 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -139,7 +139,14 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const { return passed_clipboard; } - + + // show folder links + LLViewerInventoryItem* item = gInventory.getItem(folder_id); + if (item && item->getActualType() == LLAssetType::AT_LINK_FOLDER) + { + return passed_clipboard; + } + if (mFilterOps.mFilterTypes & FILTERTYPE_CATEGORY) { // Can only filter categories for items in your inventory diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp index eb6591eb39..055ec241c5 100755 --- a/indra/newview/llmoveview.cpp +++ b/indra/newview/llmoveview.cpp @@ -698,14 +698,14 @@ void LLPanelStandStopFlying::updatePosition() S32 y_pos = 0; S32 bottom_tb_center = 0; - if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_BOTTOM)) + if (LLToolBar* toolbar_bottom = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_BOTTOM)) { y_pos = toolbar_bottom->getRect().getHeight(); bottom_tb_center = toolbar_bottom->getRect().getCenterX(); } S32 left_tb_width = 0; - if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarView::TOOLBAR_LEFT)) + if (LLToolBar* toolbar_left = gToolBarView->getToolbar(LLToolBarEnums::TOOLBAR_LEFT)) { left_tb_width = toolbar_left->getRect().getWidth(); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 7b397d46f3..c83b459279 100755 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6187,8 +6187,8 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; if (shader) - { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes - gSolidColorProgram.bind(); + { //use UI program for selection highlights (texture color modulated by vertex color) + gUIProgram.bind(); } gGL.matrixMode(LLRender::MM_MODELVIEW); @@ -6243,10 +6243,11 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); gGL.begin(LLRender::LINES); { + gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); + for(S32 i = 0; i < mSilhouetteVertices.size(); i += 2) { u_coord += u_divisor * LLSelectMgr::sHighlightUScale; - gGL.color4f(color.mV[VRED], color.mV[VGREEN], color.mV[VBLUE], 0.4f); gGL.texCoord2f( u_coord, v_coord ); gGL.vertex3fv( mSilhouetteVertices[i].mV); u_coord += u_divisor * LLSelectMgr::sHighlightUScale; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 67a76460a7..d5f8a1e46e 100755 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -786,14 +786,18 @@ bool idle_startup() display_startup(); LLPanelLogin::giveFocus(); - if (gSavedSettings.getBOOL("FirstLoginThisInstall")) + // MAINT-3231 Show first run dialog only for Desura viewer + if (gSavedSettings.getString("sourceid") == "1208_desura") { - LL_INFOS("AppInit") << "FirstLoginThisInstall, calling show_first_run_dialog()" << LL_ENDL; - show_first_run_dialog(); - } - else - { - LL_DEBUGS("AppInit") << "FirstLoginThisInstall off" << LL_ENDL; + if (gSavedSettings.getBOOL("FirstLoginThisInstall")) + { + LL_INFOS("AppInit") << "FirstLoginThisInstall, calling show_first_run_dialog()" << LL_ENDL; + show_first_run_dialog(); + } + else + { + LL_DEBUGS("AppInit") << "FirstLoginThisInstall off" << LL_ENDL; + } } LLStartUp::setStartupState( STATE_LOGIN_WAIT ); // Wait for user input diff --git a/indra/newview/lltoastnotifypanel.cpp b/indra/newview/lltoastnotifypanel.cpp index 3a41bf28b4..7d48634381 100755 --- a/indra/newview/lltoastnotifypanel.cpp +++ b/indra/newview/lltoastnotifypanel.cpp @@ -41,6 +41,7 @@ #include "llnotificationsutil.h" #include "llviewermessage.h" #include "llfloaterimsession.h" +#include "llavataractions.h" const S32 BOTTOM_PAD = VPAD * 3; const S32 IGNORE_BTN_TOP_DELTA = 3*VPAD;//additional ignore_btn padding @@ -313,6 +314,7 @@ void LLToastNotifyPanel::init( LLRect rect, bool show_images ) mTextBox->setVisible(TRUE); mTextBox->setPlainText(!show_images); mTextBox->setValue(mNotification->getMessage()); + mTextBox->setIsFriendCallback(LLAvatarActions::isFriend); // add buttons for a script notification if (mIsTip) diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index 78a555d67d..36d4654393 100755 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -77,7 +77,7 @@ LLToolBarView::LLToolBarView(const LLToolBarView::Params& p) mToolbarsLoaded(false), mBottomToolbarPanel(NULL) { - for (S32 i = 0; i < TOOLBAR_COUNT; i++) + for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; i++) { mToolbars[i] = NULL; } @@ -96,12 +96,18 @@ LLToolBarView::~LLToolBarView() BOOL LLToolBarView::postBuild() { - mToolbars[TOOLBAR_LEFT] = getChild<LLToolBar>("toolbar_left"); - mToolbars[TOOLBAR_RIGHT] = getChild<LLToolBar>("toolbar_right"); - mToolbars[TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom"); + mToolbars[LLToolBarEnums::TOOLBAR_LEFT] = getChild<LLToolBar>("toolbar_left"); + mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getCenterLayoutPanel()->setLocationId(LLToolBarEnums::TOOLBAR_LEFT); + + mToolbars[LLToolBarEnums::TOOLBAR_RIGHT] = getChild<LLToolBar>("toolbar_right"); + mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getCenterLayoutPanel()->setLocationId(LLToolBarEnums::TOOLBAR_RIGHT); + + mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM] = getChild<LLToolBar>("toolbar_bottom"); + mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getCenterLayoutPanel()->setLocationId(LLToolBarEnums::TOOLBAR_BOTTOM); + mBottomToolbarPanel = getChild<LLView>("bottom_toolbar_panel"); - for (int i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (int i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { mToolbars[i]->setStartDragCallback(boost::bind(LLToolBarView::startDragTool,_1,_2,_3)); mToolbars[i]->setHandleDragCallback(boost::bind(LLToolBarView::handleDragTool,_1,_2,_3,_4)); @@ -115,9 +121,9 @@ BOOL LLToolBarView::postBuild() S32 LLToolBarView::hasCommand(const LLCommandId& commandId) const { - S32 command_location = TOOLBAR_NONE; + S32 command_location = LLToolBarEnums::TOOLBAR_NONE; - for (S32 loc = TOOLBAR_FIRST; loc <= TOOLBAR_LAST; loc++) + for (S32 loc = LLToolBarEnums::TOOLBAR_FIRST; loc <= LLToolBarEnums::TOOLBAR_LAST; loc++) { if (mToolbars[loc]->hasCommand(commandId)) { @@ -129,7 +135,7 @@ S32 LLToolBarView::hasCommand(const LLCommandId& commandId) const return command_location; } -S32 LLToolBarView::addCommand(const LLCommandId& commandId, EToolBarLocation toolbar, int rank) +S32 LLToolBarView::addCommand(const LLCommandId& commandId, LLToolBarEnums::EToolBarLocation toolbar, int rank) { int old_rank; removeCommand(commandId, old_rank); @@ -144,7 +150,7 @@ S32 LLToolBarView::removeCommand(const LLCommandId& commandId, int& rank) S32 command_location = hasCommand(commandId); rank = LLToolBar::RANK_NONE; - if (command_location != TOOLBAR_NONE) + if (command_location != LLToolBarEnums::TOOLBAR_NONE) { rank = mToolbars[command_location]->removeCommand(commandId); } @@ -156,7 +162,7 @@ S32 LLToolBarView::enableCommand(const LLCommandId& commandId, bool enabled) { S32 command_location = hasCommand(commandId); - if (command_location != TOOLBAR_NONE) + if (command_location != LLToolBarEnums::TOOLBAR_NONE) { mToolbars[command_location]->enableCommand(commandId, enabled); } @@ -168,7 +174,7 @@ S32 LLToolBarView::stopCommandInProgress(const LLCommandId& commandId) { S32 command_location = hasCommand(commandId); - if (command_location != TOOLBAR_NONE) + if (command_location != LLToolBarEnums::TOOLBAR_NONE) { mToolbars[command_location]->stopCommandInProgress(commandId); } @@ -180,7 +186,7 @@ S32 LLToolBarView::flashCommand(const LLCommandId& commandId, bool flash, bool f { S32 command_location = hasCommand(commandId); - if (command_location != TOOLBAR_NONE) + if (command_location != LLToolBarEnums::TOOLBAR_NONE) { mToolbars[command_location]->flashCommand(commandId, flash, force_flashing); } @@ -259,7 +265,7 @@ bool LLToolBarView::loadToolbars(bool force_default) } // Clear the toolbars now before adding the loaded commands and settings - for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { if (mToolbars[i]) { @@ -268,46 +274,46 @@ bool LLToolBarView::loadToolbars(bool force_default) } // Add commands to each toolbar - if (toolbar_set.left_toolbar.isProvided() && mToolbars[TOOLBAR_LEFT]) + if (toolbar_set.left_toolbar.isProvided() && mToolbars[LLToolBarEnums::TOOLBAR_LEFT]) { if (toolbar_set.left_toolbar.button_display_mode.isProvided()) { LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode; - mToolbars[TOOLBAR_LEFT]->setButtonType(button_type); + mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setButtonType(button_type); } BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands) { - if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_LEFT])) + if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT])) { llwarns << "Error adding command '" << command_params.name() << "' to left toolbar." << llendl; } } } - if (toolbar_set.right_toolbar.isProvided() && mToolbars[TOOLBAR_RIGHT]) + if (toolbar_set.right_toolbar.isProvided() && mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]) { if (toolbar_set.right_toolbar.button_display_mode.isProvided()) { LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode; - mToolbars[TOOLBAR_RIGHT]->setButtonType(button_type); + mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setButtonType(button_type); } BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands) { - if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_RIGHT])) + if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT])) { llwarns << "Error adding command '" << command_params.name() << "' to right toolbar." << llendl; } } } - if (toolbar_set.bottom_toolbar.isProvided() && mToolbars[TOOLBAR_BOTTOM]) + if (toolbar_set.bottom_toolbar.isProvided() && mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]) { if (toolbar_set.bottom_toolbar.button_display_mode.isProvided()) { LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode; - mToolbars[TOOLBAR_BOTTOM]->setButtonType(button_type); + mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setButtonType(button_type); } BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands) { - if (addCommandInternal(LLCommandId(command_params), mToolbars[TOOLBAR_BOTTOM])) + if (addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM])) { llwarns << "Error adding command '" << command_params.name() << "' to bottom toolbar." << llendl; } @@ -319,7 +325,7 @@ bool LLToolBarView::loadToolbars(bool force_default) bool LLToolBarView::clearToolbars() { - for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { if (mToolbars[i]) { @@ -371,20 +377,20 @@ void LLToolBarView::saveToolbars() const // Build the parameter tree from the toolbar data LLToolBarView::ToolbarSet toolbar_set; - if (mToolbars[TOOLBAR_LEFT]) + if (mToolbars[LLToolBarEnums::TOOLBAR_LEFT]) { - toolbar_set.left_toolbar.button_display_mode = mToolbars[TOOLBAR_LEFT]->getButtonType(); - addToToolset(mToolbars[TOOLBAR_LEFT]->getCommandsList(), toolbar_set.left_toolbar); + toolbar_set.left_toolbar.button_display_mode = mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getButtonType(); + addToToolset(mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->getCommandsList(), toolbar_set.left_toolbar); } - if (mToolbars[TOOLBAR_RIGHT]) + if (mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]) { - toolbar_set.right_toolbar.button_display_mode = mToolbars[TOOLBAR_RIGHT]->getButtonType(); - addToToolset(mToolbars[TOOLBAR_RIGHT]->getCommandsList(), toolbar_set.right_toolbar); + toolbar_set.right_toolbar.button_display_mode = mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getButtonType(); + addToToolset(mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->getCommandsList(), toolbar_set.right_toolbar); } - if (mToolbars[TOOLBAR_BOTTOM]) + if (mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]) { - toolbar_set.bottom_toolbar.button_display_mode = mToolbars[TOOLBAR_BOTTOM]->getButtonType(); - addToToolset(mToolbars[TOOLBAR_BOTTOM]->getCommandsList(), toolbar_set.bottom_toolbar); + toolbar_set.bottom_toolbar.button_display_mode = mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getButtonType(); + addToToolset(mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->getCommandsList(), toolbar_set.bottom_toolbar); } // Serialize the parameter tree @@ -511,9 +517,9 @@ void LLToolBarView::onToolBarButtonRemoved(LLView* button) void LLToolBarView::draw() { - LLRect toolbar_rects[TOOLBAR_COUNT]; + LLRect toolbar_rects[LLToolBarEnums::TOOLBAR_COUNT]; - for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { if (mToolbars[i]) { @@ -532,7 +538,7 @@ void LLToolBarView::draw() } } - for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { mToolbars[i]->getParent()->setVisible(mShowToolbars && (mToolbars[i]->hasButtons() @@ -544,7 +550,7 @@ void LLToolBarView::draw() { LLColor4 drop_color = LLUIColorTable::instance().getColor( "ToolbarDropZoneColor" ); - for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { gl_rect_2d(toolbar_rects[i], drop_color, TRUE); } @@ -620,7 +626,7 @@ BOOL LLToolBarView::handleDropTool( void* cargo_data, S32 x, S32 y, LLToolBar* t S32 old_toolbar_loc = gToolBarView->hasCommand(command_id); LLToolBar* old_toolbar = NULL; - if (old_toolbar_loc != TOOLBAR_NONE) + if (old_toolbar_loc != LLToolBarEnums::TOOLBAR_NONE) { llassert(gToolBarView->mDragToolbarButton); old_toolbar = gToolBarView->mDragToolbarButton->getParentByType<LLToolBar>(); @@ -683,7 +689,7 @@ bool LLToolBarView::isModified() const { bool modified = false; - for (S32 i = TOOLBAR_FIRST; i <= TOOLBAR_LAST; i++) + for (S32 i = LLToolBarEnums::TOOLBAR_FIRST; i <= LLToolBarEnums::TOOLBAR_LAST; i++) { modified |= mToolbars[i]->isModified(); } diff --git a/indra/newview/lltoolbarview.h b/indra/newview/lltoolbarview.h index dcc3862074..a230c2fdee 100755 --- a/indra/newview/lltoolbarview.h +++ b/indra/newview/lltoolbarview.h @@ -40,19 +40,6 @@ class LLUICtrlFactory; class LLToolBarView : public LLUICtrl { public: - typedef enum - { - TOOLBAR_NONE = 0, - TOOLBAR_LEFT, - TOOLBAR_RIGHT, - TOOLBAR_BOTTOM, - - TOOLBAR_COUNT, - - TOOLBAR_FIRST = TOOLBAR_LEFT, - TOOLBAR_LAST = TOOLBAR_BOTTOM, - } EToolBarLocation; - // Xui structure of the toolbar panel struct Params : public LLInitParam::Block<Params, LLUICtrl::Params> {}; @@ -84,9 +71,9 @@ public: virtual void draw(); // Toolbar view interface with the rest of the world - // Checks if the commandId is being used somewhere in one of the toolbars, returns EToolBarLocation + // Checks if the commandId is being used somewhere in one of the toolbars, returns LLToolBarEnums::EToolBarLocation S32 hasCommand(const LLCommandId& commandId) const; - S32 addCommand(const LLCommandId& commandId, EToolBarLocation toolbar, int rank = LLToolBar::RANK_NONE); + S32 addCommand(const LLCommandId& commandId, LLToolBarEnums::EToolBarLocation toolbar, int rank = LLToolBar::RANK_NONE); S32 removeCommand(const LLCommandId& commandId, int& rank); // Sets the rank the removed command was at, RANK_NONE if not found S32 enableCommand(const LLCommandId& commandId, bool enabled); S32 stopCommandInProgress(const LLCommandId& commandId); @@ -109,7 +96,7 @@ public: static void resetDragTool(LLToolBarButton* toolbarButton); LLInventoryObject* getDragItem(); LLView* getBottomToolbar() { return mBottomToolbarPanel; } - LLToolBar* getToolbar(EToolBarLocation toolbar) { return mToolbars[toolbar]; } + LLToolBar* getToolbar(LLToolBarEnums::EToolBarLocation toolbar) { return mToolbars[toolbar]; } bool isModified() const; protected: @@ -127,7 +114,7 @@ private: static void onToolBarButtonRemoved(LLView* button); // Pointers to the toolbars handled by the toolbar view - LLToolBar* mToolbars[TOOLBAR_COUNT]; + LLToolBar* mToolbars[LLToolBarEnums::TOOLBAR_COUNT]; bool mToolbarsLoaded; bool mDragStarted; diff --git a/indra/newview/llurldispatcher.cpp b/indra/newview/llurldispatcher.cpp index 00b15a5f26..0c34db39b5 100755 --- a/indra/newview/llurldispatcher.cpp +++ b/indra/newview/llurldispatcher.cpp @@ -307,7 +307,7 @@ bool LLURLDispatcher::dispatchRightClick(const std::string& slurl) } // static -bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl) +bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl, bool trusted_content) { // *NOTE: Text editors are considered sources of trusted URLs // in order to make avatar profile links in chat history work. @@ -315,9 +315,9 @@ bool LLURLDispatcher::dispatchFromTextEditor(const std::string& slurl) // receiving resident will see it and must affirmatively // click on it. // *TODO: Make this trust model more refined. JC - const bool trusted_browser = true; + LLMediaCtrl* web = NULL; - return LLURLDispatcherImpl::dispatch(LLSLURL(slurl), "clicked", web, trusted_browser); + return LLURLDispatcherImpl::dispatch(LLSLURL(slurl), "clicked", web, trusted_content); } diff --git a/indra/newview/llurldispatcher.h b/indra/newview/llurldispatcher.h index 6309a97af5..9b05260af1 100755 --- a/indra/newview/llurldispatcher.h +++ b/indra/newview/llurldispatcher.h @@ -53,7 +53,7 @@ public: static bool dispatchRightClick(const std::string& slurl); - static bool dispatchFromTextEditor(const std::string& slurl); + static bool dispatchFromTextEditor(const std::string& slurl, bool trusted_content); }; #endif diff --git a/indra/newview/llurldispatcherlistener.cpp b/indra/newview/llurldispatcherlistener.cpp index c7b9afafef..7545f3a9b3 100755 --- a/indra/newview/llurldispatcherlistener.cpp +++ b/indra/newview/llurldispatcherlistener.cpp @@ -71,5 +71,5 @@ void LLURLDispatcherListener::dispatchRightClick(const LLSD& params) const void LLURLDispatcherListener::dispatchFromTextEditor(const LLSD& params) const { - LLURLDispatcher::dispatchFromTextEditor(params["url"]); + LLURLDispatcher::dispatchFromTextEditor(params["url"], false); } diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index ac2940fcfc..3710522fdd 100755 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -7193,6 +7193,17 @@ class LLAdvancedClickRenderProfile: public view_listener_t } }; +void gpu_benchmark(); + +class LLAdvancedClickRenderBenchmark: public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + gpu_benchmark(); + return true; + } +}; + void menu_toggle_attached_lights(void* user_data) { LLPipeline::sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); @@ -8633,6 +8644,7 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedCheckRenderShadowOption(), "Advanced.CheckRenderShadowOption"); view_listener_t::addMenu(new LLAdvancedClickRenderShadowOption(), "Advanced.ClickRenderShadowOption"); view_listener_t::addMenu(new LLAdvancedClickRenderProfile(), "Advanced.ClickRenderProfile"); + view_listener_t::addMenu(new LLAdvancedClickRenderBenchmark(), "Advanced.ClickRenderBenchmark"); #ifdef TOGGLE_HACKED_GODLIKE_VIEWER view_listener_t::addMenu(new LLAdvancedHandleToggleHackedGodmode(), "Advanced.HandleToggleHackedGodmode"); diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 82131c6675..5dba0640d4 100755 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -2408,14 +2408,10 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) && from_id.notNull() //not a system message && to_id.notNull()) //not global message { - // return a standard "do not disturb" message, but only do it to online IM + // return a standard "do not disturb" message, but only do it to online IM // (i.e. not other auto responses and not store-and-forward IM) - if (!gIMMgr->hasSession(session_id)) - { - // if there is not a panel for this conversation (i.e. it is a new IM conversation - // initiated by the other party) then... - send_do_not_disturb_message(msg, from_id, session_id); - } + + send_do_not_disturb_message(msg, from_id, session_id); // now store incoming IM in chat history diff --git a/indra/newview/llviewerobject.cpp b/indra/newview/llviewerobject.cpp index 1544e66431..e62998db70 100755 --- a/indra/newview/llviewerobject.cpp +++ b/indra/newview/llviewerobject.cpp @@ -236,7 +236,6 @@ LLViewerObject::LLViewerObject(const LLUUID &id, const LLPCode pcode, LLViewerRe mOnMap(FALSE), mStatic(FALSE), mNumFaces(0), - mTimeDilation(1.f), mRotTime(0.f), mAngularVelocityRot(), mPreviousRotation(), @@ -943,7 +942,6 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, U16 time_dilation16; mesgsys->getU16Fast(_PREHASH_RegionData, _PREHASH_TimeDilation, time_dilation16); F32 time_dilation = ((F32) time_dilation16) / 65535.f; - mTimeDilation = time_dilation; mRegionp->setTimeDilation(time_dilation); // this will be used to determine if we've really changed position @@ -1986,7 +1984,7 @@ U32 LLViewerObject::processUpdateMessage(LLMessageSystem *mesgsys, LLCircuitData *cdp = gMessageSystem->mCircuitInfo.findCircuit(mesgsys->getSender()); if (cdp) { - F32 ping_delay = 0.5f * mTimeDilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); + F32 ping_delay = 0.5f * time_dilation * ( ((F32)cdp->getPingDelay()) * 0.001f + gFrameDTClamped); LLVector3 diff = getVelocity() * ping_delay; new_pos_parent += diff; } @@ -2185,35 +2183,33 @@ BOOL LLViewerObject::isActive() const -void LLViewerObject::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLViewerObject::idleUpdate(LLAgent &agent, const F64 &time) { //static LLFastTimer::DeclareTimer ftm("Viewer Object"); //LLFastTimer t(ftm); if (!mDead) { - // CRO - don't velocity interp linked objects! - // Leviathan - but DO velocity interp joints - if (!mStatic && sVelocityInterpolate && !isSelected()) - { - // calculate dt from last update - F32 dt_raw = (F32)(time - mLastInterpUpdateSecs); - F32 dt = mTimeDilation * dt_raw; + if (!mStatic && sVelocityInterpolate && !isSelected()) + { + // calculate dt from last update + F32 time_dilation = mRegionp ? mRegionp->getTimeDilation() : 1.0f; + F32 dt = time_dilation * (F32)(time - mLastInterpUpdateSecs); applyAngularVelocity(dt); if (isAttachment()) - { - mLastInterpUpdateSecs = time; + { + mLastInterpUpdateSecs = time; return; + } + else + { // Move object based on it's velocity and rotation + interpolateLinearMotion(time, dt); + } } - else - { // Move object based on it's velocity and rotation - interpolateLinearMotion(time, dt); - } - } - updateDrawable(FALSE); + updateDrawable(FALSE); } } @@ -4063,7 +4059,7 @@ void LLViewerObject::setTE(const U8 te, const LLTextureEntry &texture_entry) { LLPrimitive::setTE(te, texture_entry); - const LLUUID& image_id = getTE(te)->getID(); + const LLUUID& image_id = getTE(te)->getID(); mTEImages[te] = LLViewerTextureManager::getFetchedTexture(image_id, FTT_DEFAULT, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE); if (getTE(te)->getMaterialParams().notNull()) diff --git a/indra/newview/llviewerobject.h b/indra/newview/llviewerobject.h index 80bdd628a1..c34d4493d5 100755 --- a/indra/newview/llviewerobject.h +++ b/indra/newview/llviewerobject.h @@ -143,7 +143,7 @@ public: LLNameValue* getNVPair(const std::string& name) const; // null if no name value pair by that name // Object create and update functions - virtual void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + virtual void idleUpdate(LLAgent &agent, const F64 &time); // Types of media we can associate enum { MEDIA_NONE = 0, MEDIA_SET = 1 }; @@ -305,7 +305,7 @@ public: /*virtual*/ S32 setTETexture(const U8 te, const LLUUID &uuid); /*virtual*/ S32 setTENormalMap(const U8 te, const LLUUID &uuid); /*virtual*/ S32 setTESpecularMap(const U8 te, const LLUUID &uuid); - S32 setTETextureCore(const U8 te, LLViewerTexture *image); + S32 setTETextureCore(const U8 te, LLViewerTexture *image); S32 setTENormalMapCore(const U8 te, LLViewerTexture *image); S32 setTESpecularMapCore(const U8 te, LLViewerTexture *image); /*virtual*/ S32 setTEColor(const U8 te, const LLColor3 &color); @@ -743,7 +743,6 @@ protected: BOOL mStatic; // Object doesn't move. S32 mNumFaces; - F32 mTimeDilation; // Time dilation sent with the object. F32 mRotTime; // Amount (in seconds) that object has rotated according to angular velocity (llSetTargetOmega) LLQuaternion mAngularVelocityRot; // accumulated rotation from the angular velocity computations LLQuaternion mPreviousRotation; diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index b4e287c446..f667c2bf33 100755 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -399,10 +399,10 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, if (update_type != OUT_TERSE_IMPROVED) // OUT_FULL_COMPRESSED only? { - compressed_dp.unpackUUID(fullid, "ID"); - compressed_dp.unpackU32(local_id, "LocalID"); - compressed_dp.unpackU8(pcode, "PCode"); - } + compressed_dp.unpackUUID(fullid, "ID"); + compressed_dp.unpackU32(local_id, "LocalID"); + compressed_dp.unpackU8(pcode, "PCode"); + } else { compressed_dp.unpackU32(local_id, "LocalID"); @@ -561,7 +561,7 @@ void LLViewerObjectList::processObjectUpdate(LLMessageSystem *mesgsys, processUpdateCore(objectp, user_data, i, update_type, NULL, justCreated); } recorder.objectUpdateEvent(local_id, update_type, objectp, msg_size); - objectp->setLastUpdateType(update_type); + objectp->setLastUpdateType(update_type); objectp->setLastUpdateCached(bCached); } @@ -852,7 +852,7 @@ private: LLSD mObjectIDs; }; -void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) +void LLViewerObjectList::update(LLAgent &agent) { // Update globals LLViewerObject::setVelocityInterpolate( gSavedSettings.getBOOL("VelocityInterpolate") ); @@ -942,7 +942,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) objectp = *iter; if (objectp->isAvatar()) { - objectp->idleUpdate(agent, world, frame_time); + objectp->idleUpdate(agent, frame_time); } } } @@ -953,7 +953,7 @@ void LLViewerObjectList::update(LLAgent &agent, LLWorld &world) { objectp = *idle_iter; llassert(objectp->isActive()); - objectp->idleUpdate(agent, world, frame_time); + objectp->idleUpdate(agent, frame_time); } //update flexible objects diff --git a/indra/newview/llviewerobjectlist.h b/indra/newview/llviewerobjectlist.h index 6518c25d09..98b50fa789 100755 --- a/indra/newview/llviewerobjectlist.h +++ b/indra/newview/llviewerobjectlist.h @@ -83,7 +83,7 @@ public: void processCompressedObjectUpdate(LLMessageSystem *mesgsys, void **user_data, EObjectUpdateType update_type); void processCachedObjectUpdate(LLMessageSystem *mesgsys, void **user_data, EObjectUpdateType update_type); void updateApparentAngles(LLAgent &agent); - void update(LLAgent &agent, LLWorld &world); + void update(LLAgent &agent); void fetchObjectCosts(); void fetchPhysicsFlags(); diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 553f6a2d59..e88b22b461 100755 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -87,6 +87,8 @@ LLGLSLShader gClipProgram; LLGLSLShader gDownsampleDepthProgram; LLGLSLShader gDownsampleDepthRectProgram; LLGLSLShader gAlphaMaskProgram; +LLGLSLShader gBenchmarkProgram; + //object shaders LLGLSLShader gObjectSimpleProgram; @@ -681,6 +683,7 @@ void LLViewerShaderMgr::unloadShaders() gClipProgram.unload(); gDownsampleDepthProgram.unload(); gDownsampleDepthRectProgram.unload(); + gBenchmarkProgram.unload(); gAlphaMaskProgram.unload(); gUIProgram.unload(); gPathfindingProgram.unload(); @@ -3190,6 +3193,26 @@ BOOL LLViewerShaderMgr::loadShadersInterface() if (success) { + gBenchmarkProgram.mName = "Benchmark Shader"; + gBenchmarkProgram.mShaderFiles.clear(); + gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkV.glsl", GL_VERTEX_SHADER_ARB)); + gBenchmarkProgram.mShaderFiles.push_back(make_pair("interface/benchmarkF.glsl", GL_FRAGMENT_SHADER_ARB)); + gBenchmarkProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gBenchmarkProgram.createShader(NULL, NULL); + } + + if (success) + { + gDownsampleDepthRectProgram.mName = "DownsampleDepthRect Shader"; + gDownsampleDepthRectProgram.mShaderFiles.clear(); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthRectF.glsl", GL_FRAGMENT_SHADER_ARB)); + gDownsampleDepthRectProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gDownsampleDepthRectProgram.createShader(NULL, NULL); + } + + if (success) + { gDownsampleDepthRectProgram.mName = "DownsampleDepthRect Shader"; gDownsampleDepthRectProgram.mShaderFiles.clear(); gDownsampleDepthRectProgram.mShaderFiles.push_back(make_pair("interface/downsampleDepthV.glsl", GL_VERTEX_SHADER_ARB)); diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 3d89f8d20a..53569ca7ab 100755 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -183,6 +183,7 @@ extern LLGLSLShader gDebugProgram; extern LLGLSLShader gClipProgram; extern LLGLSLShader gDownsampleDepthProgram; extern LLGLSLShader gDownsampleDepthRectProgram; +extern LLGLSLShader gBenchmarkProgram; //output tex0[tc0] + tex1[tc1] extern LLGLSLShader gTwoTextureAddProgram; diff --git a/indra/newview/llviewertexteditor.cpp b/indra/newview/llviewertexteditor.cpp index 8036a4e258..e51f7b2c71 100755 --- a/indra/newview/llviewertexteditor.cpp +++ b/indra/newview/llviewertexteditor.cpp @@ -689,6 +689,11 @@ void LLViewerTextEditor::makePristine() LLTextEditor::makePristine(); } +void LLViewerTextEditor::handleVisibilityChange( BOOL new_visibility ) +{ + LLUICtrl::handleVisibilityChange(new_visibility); +} + BOOL LLViewerTextEditor::handleMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = FALSE; diff --git a/indra/newview/llviewertexteditor.h b/indra/newview/llviewertexteditor.h index fb428d0dc1..33b78a5964 100755 --- a/indra/newview/llviewertexteditor.h +++ b/indra/newview/llviewertexteditor.h @@ -46,6 +46,8 @@ public: virtual ~LLViewerTextEditor(); virtual void makePristine(); + + /*virtual*/ void handleVisibilityChange( BOOL new_visibility ); // mousehandler overrides virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 693eca8a06..3da6d33d72 100755 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -422,7 +422,9 @@ void LLViewerTextureManager::cleanup() LLViewerFetchedTexture::sDefaultImagep = NULL; LLViewerFetchedTexture::sSmokeImagep = NULL; LLViewerFetchedTexture::sMissingAssetImagep = NULL; + LLTexUnit::sWhiteTexture = 0; LLViewerFetchedTexture::sWhiteImagep = NULL; + LLViewerFetchedTexture::sFlatNormalImagep = NULL; LLViewerMediaTexture::cleanUpClass() ; diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cb7536edce..3193a2955b 100755 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1860,6 +1860,14 @@ void LLViewerWindow::initBase() // Constrain floaters to inside the menu and status bar regions. gFloaterView = main_view->getChild<LLFloaterView>("Floater View"); + for (S32 i = 0; i < LLToolBarEnums::TOOLBAR_COUNT; ++i) + { + LLToolBar * toolbarp = gToolBarView->getToolbar((LLToolBarEnums::EToolBarLocation)i); + if (toolbarp) + { + toolbarp->getCenterLayoutPanel()->setReshapeCallback(boost::bind(&LLFloaterView::setToolbarRect, gFloaterView, _1, _2)); + } + } gFloaterView->setFloaterSnapView(main_view->getChild<LLView>("floater_snap_region")->getHandle()); gSnapshotFloaterView = main_view->getChild<LLSnapshotFloaterView>("Snapshot Floater View"); @@ -3236,8 +3244,6 @@ void LLViewerWindow::updateUI() updateLayout(); - mLastMousePoint = mCurrentMousePoint; - // cleanup unused selections when no modal dialogs are open if (LLModalDialog::activeCount() == 0) { @@ -3475,6 +3481,9 @@ void LLViewerWindow::saveLastMouse(const LLCoordGL &point) { // Store last mouse location. // If mouse leaves window, pretend last point was on edge of window + + mLastMousePoint = mCurrentMousePoint; + if (point.mX < 0) { mCurrentMousePoint.mX = 0; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index f5918a0a5f..ca3c0b1099 100755 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -116,16 +116,16 @@ using namespace LLAvatarAppearanceDefines; //----------------------------------------------------------------------------- // Global constants //----------------------------------------------------------------------------- -const LLUUID ANIM_AGENT_BODY_NOISE = LLUUID("9aa8b0a6-0c6f-9518-c7c3-4f41f2c001ad"); //"body_noise" -const LLUUID ANIM_AGENT_BREATHE_ROT = LLUUID("4c5a103e-b830-2f1c-16bc-224aa0ad5bc8"); //"breathe_rot" -const LLUUID ANIM_AGENT_EDITING = LLUUID("2a8eba1d-a7f8-5596-d44a-b4977bf8c8bb"); //"editing" -const LLUUID ANIM_AGENT_EYE = LLUUID("5c780ea8-1cd1-c463-a128-48c023f6fbea"); //"eye" -const LLUUID ANIM_AGENT_FLY_ADJUST = LLUUID("db95561f-f1b0-9f9a-7224-b12f71af126e"); //"fly_adjust" -const LLUUID ANIM_AGENT_HAND_MOTION = LLUUID("ce986325-0ba7-6e6e-cc24-b17c4b795578"); //"hand_motion" -const LLUUID ANIM_AGENT_HEAD_ROT = LLUUID("e6e8d1dd-e643-fff7-b238-c6b4b056a68d"); //"head_rot" -const LLUUID ANIM_AGENT_PELVIS_FIX = LLUUID("0c5dd2a2-514d-8893-d44d-05beffad208b"); //"pelvis_fix" -const LLUUID ANIM_AGENT_TARGET = LLUUID("0e4896cb-fba4-926c-f355-8720189d5b55"); //"target" -const LLUUID ANIM_AGENT_WALK_ADJUST = LLUUID("829bc85b-02fc-ec41-be2e-74cc6dd7215d"); //"walk_adjust" +const LLUUID ANIM_AGENT_BODY_NOISE = LLUUID("9aa8b0a6-0c6f-9518-c7c3-4f41f2c001ad"); //"body_noise" +const LLUUID ANIM_AGENT_BREATHE_ROT = LLUUID("4c5a103e-b830-2f1c-16bc-224aa0ad5bc8"); //"breathe_rot" +const LLUUID ANIM_AGENT_EDITING = LLUUID("2a8eba1d-a7f8-5596-d44a-b4977bf8c8bb"); //"editing" +const LLUUID ANIM_AGENT_EYE = LLUUID("5c780ea8-1cd1-c463-a128-48c023f6fbea"); //"eye" +const LLUUID ANIM_AGENT_FLY_ADJUST = LLUUID("db95561f-f1b0-9f9a-7224-b12f71af126e"); //"fly_adjust" +const LLUUID ANIM_AGENT_HAND_MOTION = LLUUID("ce986325-0ba7-6e6e-cc24-b17c4b795578"); //"hand_motion" +const LLUUID ANIM_AGENT_HEAD_ROT = LLUUID("e6e8d1dd-e643-fff7-b238-c6b4b056a68d"); //"head_rot" +const LLUUID ANIM_AGENT_PELVIS_FIX = LLUUID("0c5dd2a2-514d-8893-d44d-05beffad208b"); //"pelvis_fix" +const LLUUID ANIM_AGENT_TARGET = LLUUID("0e4896cb-fba4-926c-f355-8720189d5b55"); //"target" +const LLUUID ANIM_AGENT_WALK_ADJUST = LLUUID("829bc85b-02fc-ec41-be2e-74cc6dd7215d"); //"walk_adjust" const LLUUID ANIM_AGENT_PHYSICS_MOTION = LLUUID("7360e029-3cb8-ebc4-863e-212df440d987"); //"physics_motion" @@ -253,7 +253,7 @@ struct LLAppearanceMessageContents }; struct LLVOAvatarChildJoint : public LLInitParam::ChoiceBlock<LLVOAvatarChildJoint> - { +{ Alternative<Lazy<struct LLVOAvatarBoneInfo, IS_A_BLOCK> > bone; Alternative<LLVOAvatarCollisionVolumeInfo> collision_volume; @@ -813,17 +813,17 @@ void LLVOAvatar::debugAvatarRezTime(std::string notification_name, std::string c //------------------------------------------------------------------------ LLVOAvatar::~LLVOAvatar() { - if (!mFullyLoaded) - { + if (!mFullyLoaded) + { debugAvatarRezTime("AvatarRezLeftCloudNotification","left after ruth seconds as cloud"); - } - else - { + } + else + { debugAvatarRezTime("AvatarRezLeftNotification","left sometime after declouding"); - } + } logPendingPhases(); - + lldebugs << "LLVOAvatar Destructor (0x" << this << ") id:" << mID << llendl; std::for_each(mAttachmentPoints.begin(), mAttachmentPoints.end(), DeletePairedPointer()); @@ -1207,7 +1207,7 @@ void LLVOAvatar::initInstance(void) registerMotion( ANIM_AGENT_TARGET, LLTargetingMotion::create ); registerMotion( ANIM_AGENT_WALK_ADJUST, LLWalkAdjustMotion::create ); } - + LLAvatarAppearance::initInstance(); // preload specific motions here @@ -1554,7 +1554,7 @@ LLViewerObject* LLVOAvatar::lineSegmentIntersectRiggedAttachments(const LLVector return hit; } - + LLVOAvatar* LLVOAvatar::asAvatar() { return this; @@ -1889,22 +1889,22 @@ LLViewerFetchedTexture *LLVOAvatar::getBakedTextureImage(const U8 te, const LLUU } if (!result) -{ + { const std::string url = getImageURL(te,uuid); if (!url.empty()) - { + { LL_DEBUGS("Avatar") << avString() << "from URL " << url << llendl; result = LLViewerTextureManager::getFetchedTextureFromUrl( url, FTT_SERVER_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, uuid); - } - else - { + } + else + { LL_DEBUGS("Avatar") << avString() << "from host " << uuid << llendl; LLHost host = getObjectHost(); result = LLViewerTextureManager::getFetchedTexture( uuid, FTT_HOST_BAKE, TRUE, LLGLTexture::BOOST_NONE, LLViewerTexture::LOD_TEXTURE, 0, 0, host); + } } -} return result; } @@ -1955,7 +1955,7 @@ void LLVOAvatar::dumpAnimationState() //------------------------------------------------------------------------ // idleUpdate() //------------------------------------------------------------------------ -void LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOAvatar::idleUpdate(LLAgent &agent, const F64 &time) { LLFastTimer t(FTM_AVATAR_UPDATE); @@ -2010,7 +2010,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) if (isSelf()) { - LLViewerObject::idleUpdate(agent, world, time); + LLViewerObject::idleUpdate(agent, time); // trigger fidget anims if (isAnyAnimationSignaled(AGENT_STAND_ANIMS, NUM_AGENT_STAND_ANIMS)) @@ -2022,7 +2022,7 @@ void LLVOAvatar::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) { // Should override the idleUpdate stuff and leave out the angular update part. LLQuaternion rotation = getRotation(); - LLViewerObject::idleUpdate(agent, world, time); + LLViewerObject::idleUpdate(agent, time); setRotation(rotation); } @@ -4072,7 +4072,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) { LLViewerJoint* hair_mesh = getViewerJoint(MESH_ID_HAIR); if (hair_mesh) - { + { num_indices += hair_mesh->render(mAdjustedPixelArea, first_pass, mIsDummy); } first_pass = FALSE; @@ -4082,7 +4082,7 @@ U32 LLVOAvatar::renderTransparent(BOOL first_pass) gGL.setAlphaRejectSettings(LLRender::CF_DEFAULT); } } - + return num_indices; } @@ -5147,7 +5147,7 @@ void LLVOAvatar::getGround(const LLVector3 &in_pos_agent, LLVector3 &out_pos_age //----------------------------------------------------------------------------- F32 LLVOAvatar::getTimeDilation() { - return mTimeDilation; + return mRegionp ? mRegionp->getTimeDilation() : 1.f; } @@ -5199,9 +5199,9 @@ BOOL LLVOAvatar::loadSkeletonNode () { if (!LLAvatarAppearance::loadSkeletonNode()) { - return FALSE; - } - + return FALSE; + } + // ATTACHMENTS { LLAvatarXmlInfo::attachment_info_list_t::iterator iter; @@ -5566,7 +5566,7 @@ LLViewerJointAttachment* LLVOAvatar::getTargetAttachmentPoint(LLViewerObject* vi << " trying to use 1 (chest)" << llendl; - attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) + attachment = get_if_there(mAttachmentPoints, 1, (LLViewerJointAttachment*)NULL); // Arbitrary using 1 (chest) if (attachment) { llwarns << "Object attachment point invalid: " << attachmentID @@ -5744,7 +5744,8 @@ void LLVOAvatar::cleanupAttachedMesh( LLViewerObject* pVO ) } } } - } +} + //----------------------------------------------------------------------------- // detachObject() //----------------------------------------------------------------------------- @@ -5957,18 +5958,18 @@ BOOL LLVOAvatar::isWearingWearableType(LLWearableType::EType type) const { const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = tex_iter->second; if (texture_dict->mWearableType == type) - { + { // Thus, you must check to see if the corresponding baked texture is defined. // NOTE: this is a poor substitute if you actually want to know about individual pieces of clothing // this works for detecting a skirt (most important), but is ineffective at any piece of clothing that // gets baked into a texture that always exists (upper or lower). if (texture_dict->mIsUsedByBakedTexture) - { + { const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return isTextureDefined(LLAvatarAppearanceDictionary::getInstance()->getBakedTexture(baked_index)->mTextureIndex); - } + } return FALSE; - } + } } return FALSE; } @@ -6033,7 +6034,7 @@ void LLVOAvatar::onGlobalColorChanged(const LLTexGlobalColor* global_color, BOOL { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( color ); } } @@ -6101,9 +6102,9 @@ void LLVOAvatar::updateRezzedStatusTimers() { // load level has decreased. start phase timers for higher load levels. for (S32 i = rez_status+1; i <= mLastRezzedStatus; i++) - { + { startPhase("load_" + LLVOAvatar::rezStatusToString(i)); - } + } } else if (rez_status > mLastRezzedStatus) { @@ -6112,16 +6113,16 @@ void LLVOAvatar::updateRezzedStatusTimers() { stopPhase("load_" + LLVOAvatar::rezStatusToString(i)); stopPhase("first_load_" + LLVOAvatar::rezStatusToString(i), false); - } + } if (rez_status == 3) - { + { // "fully loaded", mark any pending appearance change complete. selfStopPhase("update_appearance_from_cof"); selfStopPhase("wear_inventory_category", false); selfStopPhase("process_initial_wearables_update", false); } } - + mLastRezzedStatus = rez_status; } } @@ -6148,7 +6149,7 @@ void LLVOAvatar::startPhase(const std::string& phase_name) } void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) - { +{ F32 elapsed; bool completed; if (getPhases().getPhaseValues(phase_name, elapsed, completed)) @@ -6180,7 +6181,7 @@ void LLVOAvatar::stopPhase(const std::string& phase_name, bool err_check) void LLVOAvatar::logPendingPhases() { if (!isAgentAvatarValid()) - { + { return; } @@ -6196,14 +6197,14 @@ void LLVOAvatar::logPendingPhases() if (!completed) { logMetricsTimerRecord(phase_name, elapsed, completed); - } + } } } - } +} //static void LLVOAvatar::logPendingPhasesAllAvatars() - { +{ for (std::vector<LLCharacter*>::iterator iter = LLCharacter::sInstances.begin(); iter != LLCharacter::sInstances.end(); ++iter) { @@ -6214,14 +6215,14 @@ void LLVOAvatar::logPendingPhasesAllAvatars() } inst->logPendingPhases(); } - } +} void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapsed, bool completed) - { +{ if (!isAgentAvatarValid()) - { + { return; - } + } LLSD record; record["timer_name"] = phase_name; @@ -6230,15 +6231,15 @@ void LLVOAvatar::logMetricsTimerRecord(const std::string& phase_name, F32 elapse record["completed"] = completed; U32 grid_x(0), grid_y(0); if (getRegion()) - { + { record["central_bake_version"] = LLSD::Integer(getRegion()->getCentralBakeVersion()); grid_from_region_handle(getRegion()->getHandle(), &grid_x, &grid_y); - } + } record["grid_x"] = LLSD::Integer(grid_x); record["grid_y"] = LLSD::Integer(grid_y); record["is_using_server_bakes"] = ((bool) isUsingServerBakes()); record["is_self"] = isSelf(); - + if (isAgentAvatarValid()) { gAgentAvatarp->addMetricsTimerRecord(record); @@ -6446,28 +6447,28 @@ void LLVOAvatar::updateMeshTextures() use_lkg_baked_layer[i], last_id_string.c_str()); } - + for (U32 i=0; i < mBakedTextureDatas.size(); i++) { debugColorizeSubMeshes(i, LLColor4::white); LLViewerTexLayerSet* layerset = getTexLayerSet(i); if (use_lkg_baked_layer[i] && !isUsingLocalAppearance() ) - { + { LLViewerFetchedTexture* baked_img = LLViewerTextureManager::getFetchedTexture(mBakedTextureDatas[i].mLastTextureID); mBakedTextureDatas[i].mIsUsed = TRUE; debugColorizeSubMeshes(i,LLColor4::red); - + avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( baked_img ); - } + } } } else if (!isUsingLocalAppearance() && is_layer_baked[i]) @@ -6511,7 +6512,7 @@ void LLVOAvatar::updateMeshTextures() if (mesh) { mesh->setLayerSet( layerset ); - } + } } } else @@ -6533,7 +6534,7 @@ void LLVOAvatar::updateMeshTextures() { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( color ); mesh->setTexture( hair_img ); } @@ -6561,7 +6562,15 @@ void LLVOAvatar::updateMeshTextures() } } } - removeMissingBakedTextures(); + + // removeMissingBakedTextures() will call back into this rountine if something is removed, and can blow up the stack + static bool call_remove_missing = true; + if (call_remove_missing) + { + call_remove_missing = false; + removeMissingBakedTextures(); // May call back into this function if anything is removed + call_remove_missing = true; + } } // virtual @@ -6621,13 +6630,13 @@ void LLVOAvatar::applyMorphMask(U8* tex_data, S32 width, S32 height, S32 num_com for (morph_list_t::const_iterator iter = mBakedTextureDatas[index].mMaskedMorphs.begin(); iter != mBakedTextureDatas[index].mMaskedMorphs.end(); ++iter) -{ + { const LLMaskedMorph* maskedMorph = (*iter); LLPolyMorphTarget* morph_target = dynamic_cast<LLPolyMorphTarget*>(maskedMorph->mMorphTarget); if (morph_target) - { + { morph_target->applyMask(tex_data, width, height, num_components, maskedMorph->mInvert); -} + } } } @@ -6910,8 +6919,8 @@ void dump_visual_param(apr_file_t* file, LLVisualParam* viewer_param, F32 value) LLWearableType::getTypeName(LLWearableType::EType(wtype)).c_str() // param_location_name(vparam->getParamLocation()).c_str() ); - } - +} + void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, const LLAppearanceMessageContents& contents) @@ -6925,9 +6934,9 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, outfile.open(fullpath, LL_APR_WB ); apr_file_t* file = outfile.getFileHandle(); if (!file) - { - return; - } + { + return; + } else { LL_DEBUGS("Avatar") << "dumping appearance message to " << fullpath << llendl; @@ -6961,7 +6970,7 @@ void LLVOAvatar::dumpAppearanceMsgParams( const std::string& dump_prefix, apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", i, uuid_str.c_str()); } apr_file_printf(file, "</textures>\n"); - } +} void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMessageContents& contents) { @@ -6978,7 +6987,7 @@ void LLVOAvatar::parseAppearanceMessage(LLMessageSystem* mesgsys, LLAppearanceMe // For future use: //mesgsys->getU32Fast(_PREHASH_AppearanceData, _PREHASH_Flags, appearance_flags, 0); } - + // Parse visual params, if any. S32 num_blocks = mesgsys->getNumberOfBlocksFast(_PREHASH_VisualParam); bool drop_visual_params_debug = gSavedSettings.getBOOL("BlockSomeAvatarAppearanceVisualParams") && (ll_rand(2) == 0); // pretend that ~12% of AvatarAppearance messages arrived without a VisualParam block, for testing @@ -7206,19 +7215,19 @@ void LLVOAvatar::processAvatarAppearance( LLMessageSystem* mesgsys ) LLVisualParam* param = contents.mParams[i]; F32 newWeight = contents.mParamWeights[i]; - if (is_first_appearance_message || (param->getWeight() != newWeight)) + if (is_first_appearance_message || (param->getWeight() != newWeight)) + { + params_changed = TRUE; + if(is_first_appearance_message) { - params_changed = TRUE; - if(is_first_appearance_message) - { - param->setWeight(newWeight, FALSE); - } - else - { - interp_params = TRUE; - param->setAnimationTarget(newWeight, FALSE); - } + param->setWeight(newWeight, FALSE); } + else + { + interp_params = TRUE; + param->setAnimationTarget(newWeight, FALSE); + } + } } const S32 expected_tweakable_count = getVisualParamCountInGroup(VISUAL_PARAM_GROUP_TWEAKABLE); // don't worry about VISUAL_PARAM_GROUP_TWEAKABLE_NO_TRANSMIT if (num_params != expected_tweakable_count) @@ -7474,12 +7483,12 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) avatar_joint_mesh_list_t::iterator iter = mBakedTextureDatas[i].mJointMeshes.begin(); avatar_joint_mesh_list_t::iterator end = mBakedTextureDatas[i].mJointMeshes.end(); for (; iter != end; ++iter) - { + { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setTexture( image_baked ); - } + } } } @@ -7503,7 +7512,7 @@ void LLVOAvatar::useBakedTexture( const LLUUID& id ) { LLAvatarJointMesh* mesh = (*iter); if (mesh) - { + { mesh->setColor( LLColor4::white ); } } @@ -7522,7 +7531,7 @@ std::string get_sequential_numbered_file_name(const std::string& prefix, file_num_type::iterator it = file_nums.find(prefix); S32 num = 0; if (it != file_nums.end()) -{ + { num = it->second; } file_nums[prefix] = num+1; @@ -7539,7 +7548,7 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara outprefix = getFullname() + (isSelf()?"_s":"_o"); } if (outprefix.empty()) -{ + { outprefix = getFullname() + (isSelf()?"_s":"_o"); } if (outprefix.empty()) @@ -7568,36 +7577,36 @@ void LLVOAvatar::dumpArchetypeXML(const std::string& prefix, bool group_by_weara if (group_by_wearables) { for (S32 type = LLWearableType::WT_SHAPE; type < LLWearableType::WT_COUNT; type++) - { - const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); - apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); + { + const std::string& wearable_name = LLWearableType::getTypeName((LLWearableType::EType)type); + apr_file_printf( file, "\n\t\t<!-- wearable: %s -->\n", wearable_name.c_str() ); for (LLVisualParam* param = getFirstVisualParam(); param; param = getNextVisualParam()) - { - LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; - if( (viewer_param->getWearableType() == type) && - (viewer_param->isTweakable() ) ) { + LLViewerVisualParam* viewer_param = (LLViewerVisualParam*)param; + if( (viewer_param->getWearableType() == type) && + (viewer_param->isTweakable() ) ) + { dump_visual_param(file, viewer_param, viewer_param->getWeight()); + } } - } - for (U8 te = 0; te < TEX_NUM_INDICES; te++) - { - if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) + for (U8 te = 0; te < TEX_NUM_INDICES; te++) { - // MULTIPLE_WEARABLES: extend to multiple wearables? - LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); - if( te_image ) + if (LLAvatarAppearanceDictionary::getTEWearableType((ETextureIndex)te) == type) { - std::string uuid_str; - te_image->getID().toString( uuid_str ); - apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + // MULTIPLE_WEARABLES: extend to multiple wearables? + LLViewerTexture* te_image = getImage((ETextureIndex)te, 0); + if( te_image ) + { + std::string uuid_str; + te_image->getID().toString( uuid_str ); + apr_file_printf( file, "\t\t<texture te=\"%i\" uuid=\"%s\"/>\n", te, uuid_str.c_str()); + } } } } } - } else { // Just dump all params sequentially. @@ -7743,12 +7752,12 @@ void LLVOAvatar::startAppearanceAnimation() // virtual void LLVOAvatar::bodySizeChanged() -{ +{ if (isSelf() && !LLAppearanceMgr::instance().isInUpdateAppearanceFromCOF()) { // notify simulator of change in size // but not if we are in the middle of updating appearance gAgent.sendAgentSetAppearance(); -} + } } BOOL LLVOAvatar::isUsingServerBakes() const @@ -7760,25 +7769,25 @@ BOOL LLVOAvatar::isUsingServerBakes() const F32 wt = appearance_version_param->getWeight(); F32 expect_wt = mUseServerBakes ? 1.0 : 0.0; if (!is_approx_equal(wt,expect_wt)) -{ + { llwarns << "wt " << wt << " differs from expected " << expect_wt << llendl; } #endif return mUseServerBakes; - } - +} + void LLVOAvatar::setIsUsingServerBakes(BOOL newval) - { +{ mUseServerBakes = newval; LLVisualParam* appearance_version_param = getVisualParam(11000); llassert(appearance_version_param); appearance_version_param->setWeight(newval ? 1.0 : 0.0, false); - } +} // virtual void LLVOAvatar::removeMissingBakedTextures() - { +{ } //virtual diff --git a/indra/newview/llvoavatar.h b/indra/newview/llvoavatar.h index 9d45a74ecc..4ca75b0c55 100755 --- a/indra/newview/llvoavatar.h +++ b/indra/newview/llvoavatar.h @@ -129,28 +129,28 @@ public: /*virtual*/ void updateGL(); /*virtual*/ LLVOAvatar* asAvatar(); virtual U32 processUpdateMessage(LLMessageSystem *mesgsys, - void **user_data, - U32 block_num, - const EObjectUpdateType update_type, - LLDataPacker *dp); - virtual void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + void **user_data, + U32 block_num, + const EObjectUpdateType update_type, + LLDataPacker *dp); + virtual void idleUpdate(LLAgent &agent, const F64 &time); /*virtual*/ BOOL updateLOD(); BOOL updateJointLODs(); void updateLODRiggedAttachments( void ); /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. S32 totalTextureMemForUUIDS(std::set<LLUUID>& ids); - bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const; - bool allLocalTexturesCompletelyDownloaded() const; - bool allBakedTexturesCompletelyDownloaded() const; - void bakedTextureOriginCounts(S32 &sb_count, S32 &host_count, - S32 &both_count, S32 &neither_count); - std::string bakedTextureOriginInfo(); - void collectLocalTextureUUIDs(std::set<LLUUID>& ids) const; - void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const; - void collectTextureUUIDs(std::set<LLUUID>& ids); - void releaseOldTextures(); + bool allTexturesCompletelyDownloaded(std::set<LLUUID>& ids) const; + bool allLocalTexturesCompletelyDownloaded() const; + bool allBakedTexturesCompletelyDownloaded() const; + void bakedTextureOriginCounts(S32 &sb_count, S32 &host_count, + S32 &both_count, S32 &neither_count); + std::string bakedTextureOriginInfo(); + void collectLocalTextureUUIDs(std::set<LLUUID>& ids) const; + void collectBakedTextureUUIDs(std::set<LLUUID>& ids) const; + void collectTextureUUIDs(std::set<LLUUID>& ids); + void releaseOldTextures(); /*virtual*/ void updateTextures(); - LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid); + LLViewerFetchedTexture* getBakedTextureImage(const U8 te, const LLUUID& uuid); /*virtual*/ S32 setTETexture(const U8 te, const LLUUID& uuid); // If setting a baked texture, need to request it from a non-local sim. /*virtual*/ void onShift(const LLVector4a& shift_vector); /*virtual*/ U32 getPartitionType() const; diff --git a/indra/newview/llvoavatarself.cpp b/indra/newview/llvoavatarself.cpp index 9ce99444d9..082a85e217 100755 --- a/indra/newview/llvoavatarself.cpp +++ b/indra/newview/llvoavatarself.cpp @@ -625,11 +625,11 @@ BOOL LLVOAvatarSelf::isValid() const } // virtual -void LLVOAvatarSelf::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOAvatarSelf::idleUpdate(LLAgent &agent, const F64 &time) { if (isValid()) { - LLVOAvatar::idleUpdate(agent, world, time); + LLVOAvatar::idleUpdate(agent, time); idleUpdateTractorBeam(); } } @@ -847,7 +847,7 @@ void LLVOAvatarSelf::removeMissingBakedTextures() if (!tex || tex->isMissingAsset()) { LLViewerTexture *imagep = LLViewerTextureManager::getFetchedTexture(IMG_DEFAULT_AVATAR); - if (imagep) + if (imagep && imagep != tex) { setTEImage(te, imagep); removed = TRUE; @@ -863,13 +863,13 @@ void LLVOAvatarSelf::removeMissingBakedTextures() layerset->setUpdatesEnabled(TRUE); invalidateComposite(layerset, FALSE); } - updateMeshTextures(); + updateMeshTextures(); // may call back into this function if (getRegion() && !getRegion()->getCentralBakeVersion()) { - requestLayerSetUploads(); + requestLayerSetUploads(); + } } } -} //virtual void LLVOAvatarSelf::updateRegion(LLViewerRegion *regionp) @@ -1310,7 +1310,7 @@ void LLVOAvatarSelf::localTextureLoaded(BOOL success, LLViewerFetchedTexture *sr discard_level < local_tex_obj->getDiscard()) { local_tex_obj->setDiscard(discard_level); - requestLayerSetUpdate(index); + requestLayerSetUpdate(index); if (isEditingAppearance()) { LLVisualParamHint::requestHintUpdates(); @@ -1799,11 +1799,11 @@ void LLVOAvatarSelf::setLocalTexture(ETextureIndex type, LLViewerTexture* src_te { requestLayerSetUpdate(type); if (isEditingAppearance()) - { - LLVisualParamHint::requestHintUpdates(); + { + LLVisualParamHint::requestHintUpdates(); + } } } - } else { tex->setLoadedCallback(onLocalTextureLoaded, desired_discard, TRUE, FALSE, new LLAvatarTexData(getID(), type), NULL); @@ -2580,25 +2580,25 @@ void LLVOAvatarSelf::addLocalTextureStats( ETextureIndex type, LLViewerFetchedTe //if (!covered_by_baked) { if (imagep->getID() != IMG_DEFAULT_AVATAR) - { + { imagep->setNoDelete(); if (imagep->getDiscardLevel() != 0) - { - F32 desired_pixels; - desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); - - imagep->setBoostLevel(getAvatarBoostLevel()); - imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; - imagep->resetTextureStats(); - imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); - imagep->addTextureStats( desired_pixels / texel_area_ratio ); - imagep->forceUpdateBindStats() ; - if (imagep->getDiscardLevel() < 0) { - mHasGrey = TRUE; // for statistics gathering + F32 desired_pixels; + desired_pixels = llmin(mPixelArea, (F32)getTexImageArea()); + + imagep->setBoostLevel(getAvatarBoostLevel()); + imagep->setAdditionalDecodePriority(SELF_ADDITIONAL_PRI) ; + imagep->resetTextureStats(); + imagep->setMaxVirtualSizeResetInterval(MAX_TEXTURE_VIRTURE_SIZE_RESET_INTERVAL); + imagep->addTextureStats( desired_pixels / texel_area_ratio ); + imagep->forceUpdateBindStats() ; + if (imagep->getDiscardLevel() < 0) + { + mHasGrey = TRUE; // for statistics gathering + } } } - } else { // texture asset is missing @@ -2921,17 +2921,17 @@ void LLVOAvatarSelf::requestLayerSetUpdate(ETextureIndex index ) LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(ETextureIndex index) const { - /* switch(index) - case TEX_HEAD_BAKED: - case TEX_HEAD_BODYPAINT: - return mHeadLayerSet; */ + /* switch(index) + case TEX_HEAD_BAKED: + case TEX_HEAD_BODYPAINT: + return mHeadLayerSet; */ const LLAvatarAppearanceDictionary::TextureEntry *texture_dict = LLAvatarAppearanceDictionary::getInstance()->getTexture(index); - if (texture_dict->mIsUsedByBakedTexture) - { - const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; + if (texture_dict->mIsUsedByBakedTexture) + { + const EBakedTextureIndex baked_index = texture_dict->mBakedTextureIndex; return getLayerSet(baked_index); - } - return NULL; + } + return NULL; } LLViewerTexLayerSet* LLVOAvatarSelf::getLayerSet(EBakedTextureIndex baked_index) const @@ -2959,7 +2959,7 @@ void LLVOAvatarSelf::onCustomizeStart(bool disable_camera_switch) gAgentAvatarp->mUseLocalAppearance = true; if (gSavedSettings.getBOOL("AppearanceCameraMovement") && !disable_camera_switch) -{ + { gAgentCamera.changeCameraToCustomizeAvatar(); } diff --git a/indra/newview/llvoavatarself.h b/indra/newview/llvoavatarself.h index 3b7b6bac64..521c86e1c3 100755 --- a/indra/newview/llvoavatarself.h +++ b/indra/newview/llvoavatarself.h @@ -84,7 +84,7 @@ protected: //-------------------------------------------------------------------- public: /*virtual*/ void updateRegion(LLViewerRegion *regionp); - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); //-------------------------------------------------------------------- // LLCharacter interface and related diff --git a/indra/newview/llvograss.cpp b/indra/newview/llvograss.cpp index 591d5cae0b..485b0dc8ad 100755 --- a/indra/newview/llvograss.cpp +++ b/indra/newview/llvograss.cpp @@ -277,7 +277,7 @@ BOOL LLVOGrass::isActive() const return TRUE; } -void LLVOGrass::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOGrass::idleUpdate(LLAgent &agent, const F64 &time) { if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_GRASS))) { diff --git a/indra/newview/llvograss.h b/indra/newview/llvograss.h index e54de85412..ff4fa6b00d 100755 --- a/indra/newview/llvograss.h +++ b/indra/newview/llvograss.h @@ -74,7 +74,7 @@ public: void plantBlades(); /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); /*virtual*/ BOOL lineSegmentIntersect(const LLVector4a& start, const LLVector4a& end, S32 face = -1, // which face to check, -1 = ALL_SIDES diff --git a/indra/newview/llvoground.cpp b/indra/newview/llvoground.cpp index 97b7418b40..c1273e684c 100755 --- a/indra/newview/llvoground.cpp +++ b/indra/newview/llvoground.cpp @@ -49,7 +49,7 @@ LLVOGround::~LLVOGround() { } -void LLVOGround::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOGround::idleUpdate(LLAgent &agent, const F64 &time) { } diff --git a/indra/newview/llvoground.h b/indra/newview/llvoground.h index 290579b4da..a53f309e46 100755 --- a/indra/newview/llvoground.h +++ b/indra/newview/llvoground.h @@ -41,7 +41,7 @@ protected: public: LLVOGround(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); // Graphical stuff for objects - maybe broken out into render class // later? diff --git a/indra/newview/llvoicechannel.cpp b/indra/newview/llvoicechannel.cpp index ac2a34ba1e..665892a615 100755 --- a/indra/newview/llvoicechannel.cpp +++ b/indra/newview/llvoicechannel.cpp @@ -790,6 +790,7 @@ void LLVoiceChannelP2P::handleStatusChange(EStatusType type) { // other user declined call LLNotificationsUtil::add("P2PCallDeclined", mNotifyArgs); + setState(STATE_ERROR); } else { diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9497041482..050d9dd785 100755 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -261,6 +261,7 @@ LLVivoxVoiceClient::LLVivoxVoiceClient() : mSessionTerminateRequested(false), mRelogRequested(false), mConnected(false), + mTerminateDaemon(false), mPump(NULL), mSpatialJoiningNum(0), @@ -695,7 +696,7 @@ void LLVivoxVoiceClient::stateMachine() setVoiceEnabled(false); } - if(mVoiceEnabled || !mIsInitialized) + if(mVoiceEnabled || (!mIsInitialized &&!mTerminateDaemon) ) { updatePosition(); } @@ -708,11 +709,12 @@ void LLVivoxVoiceClient::stateMachine() if((getState() != stateDisabled) && (getState() != stateDisableCleanup)) { // User turned off voice support. Send the cleanup messages, close the socket, and reset. - if(!mConnected) + if(!mConnected || mTerminateDaemon) { // if voice was turned off after the daemon was launched but before we could connect to it, we may need to issue a kill. LL_INFOS("Voice") << "Disabling voice before connection to daemon, terminating." << LL_ENDL; killGateway(); + mTerminateDaemon = false; } logout(); @@ -753,7 +755,7 @@ void LLVivoxVoiceClient::stateMachine() // Voice is locked out, we must not launch the vivox daemon. setState(stateJail); } - else if(!isGatewayRunning()) + else if(!isGatewayRunning() && gSavedSettings.getBOOL("EnableVoiceChat")) { if (true) // production build, not test { @@ -1136,6 +1138,7 @@ void LLVivoxVoiceClient::stateMachine() std::stringstream errs; errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000"; args["HOSTID"] = errs.str(); + mTerminateDaemon = true; if (LLGridManager::getInstance()->isSystemGrid()) { LLNotificationsUtil::add("NoVoiceConnect", args); @@ -2618,6 +2621,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st std::stringstream errs; errs << mVoiceAccountServerURI << "\n:UDP: 3478, 3479, 5060, 5062, 12000-17000"; args["HOSTID"] = errs.str(); + mTerminateDaemon = true; if (LLGridManager::getInstance()->isSystemGrid()) { LLNotificationsUtil::add("NoVoiceConnect", args); @@ -2633,6 +2637,7 @@ void LLVivoxVoiceClient::connectorCreateResponse(int statusCode, std::string &st LL_INFOS("Voice") << "Connector.Create succeeded, Vivox SDK version is " << versionID << LL_ENDL; mVoiceVersion.serverVersion = versionID; mConnectorHandle = connectorHandle; + mTerminateDaemon = false; if(getState() == stateConnectorStarting) { setState(stateConnectorStarted); diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index e2d1585c15..c325d72ba6 100755 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -659,6 +659,8 @@ private: LLSocket::ptr_t mSocket; bool mConnected; + // We should kill the voice daemon in case of connection alert + bool mTerminateDaemon; LLPumpIO *mPump; friend class LLVivoxProtocolParser; diff --git a/indra/newview/llvopartgroup.cpp b/indra/newview/llvopartgroup.cpp index 9f4f11b317..54e27ff4c6 100755 --- a/indra/newview/llvopartgroup.cpp +++ b/indra/newview/llvopartgroup.cpp @@ -200,7 +200,7 @@ void LLVOPartGroup::updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax) mDrawable->setPositionGroup(p); } -void LLVOPartGroup::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOPartGroup::idleUpdate(LLAgent &agent, const F64 &time) { } diff --git a/indra/newview/llvopartgroup.h b/indra/newview/llvopartgroup.h index 724e915d02..a94a2291ed 100755 --- a/indra/newview/llvopartgroup.h +++ b/indra/newview/llvopartgroup.h @@ -63,7 +63,7 @@ public: LLVOPartGroup(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. - void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + void idleUpdate(LLAgent &agent, const F64 &time); virtual F32 getBinRadius(); virtual void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); diff --git a/indra/newview/llvosky.cpp b/indra/newview/llvosky.cpp index 36793017ed..93f0e50336 100755 --- a/indra/newview/llvosky.cpp +++ b/indra/newview/llvosky.cpp @@ -1052,7 +1052,7 @@ void LLVOSky::calcAtmospherics(void) mFadeColor.setAlpha(0); } -void LLVOSky::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOSky::idleUpdate(LLAgent &agent, const F64 &time) { } diff --git a/indra/newview/llvosky.h b/indra/newview/llvosky.h index 2a150eccb9..ee8e91fb71 100755 --- a/indra/newview/llvosky.h +++ b/indra/newview/llvosky.h @@ -461,7 +461,7 @@ public: void cleanupGL(); void restoreGL(); - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); BOOL updateSky(); // Graphical stuff for objects - maybe broken out into render class diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index cd12cd9552..6a89100bf5 100755 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -339,7 +339,7 @@ U32 LLVOTree::processUpdateMessage(LLMessageSystem *mesgsys, return retval; } -void LLVOTree::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOTree::idleUpdate(LLAgent &agent, const F64 &time) { if (mDead || !(gPipeline.hasRenderType(LLPipeline::RENDER_TYPE_TREE))) { diff --git a/indra/newview/llvotree.h b/indra/newview/llvotree.h index 2ecb0303a1..6137ae412d 100755 --- a/indra/newview/llvotree.h +++ b/indra/newview/llvotree.h @@ -59,7 +59,7 @@ public: void **user_data, U32 block_num, const EObjectUpdateType update_type, LLDataPacker *dp); - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); // Graphical stuff for objects - maybe broken out into render class later? /*virtual*/ void render(LLAgent &agent); diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index e8a1c3d1d6..21595ee0bc 100755 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -100,7 +100,7 @@ void LLVOWater::updateTextures() } // Never gets called -void LLVOWater::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOWater::idleUpdate(LLAgent &agent, const F64 &time) { } diff --git a/indra/newview/llvowater.h b/indra/newview/llvowater.h index cf9323ef2e..7a8d819215 100755 --- a/indra/newview/llvowater.h +++ b/indra/newview/llvowater.h @@ -58,7 +58,7 @@ public: static void initClass(); static void cleanupClass(); - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); /*virtual*/ void updateSpatialExtents(LLVector4a& newMin, LLVector4a& newMax); diff --git a/indra/newview/llvowlsky.cpp b/indra/newview/llvowlsky.cpp index 4e26587184..e7435b6860 100755 --- a/indra/newview/llvowlsky.cpp +++ b/indra/newview/llvowlsky.cpp @@ -92,7 +92,7 @@ void LLVOWLSky::initSunDirection(LLVector3 const & sun_direction, { } -void LLVOWLSky::idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time) +void LLVOWLSky::idleUpdate(LLAgent &agent, const F64 &time) { } diff --git a/indra/newview/llvowlsky.h b/indra/newview/llvowlsky.h index 729dced15e..1d419b5fea 100755 --- a/indra/newview/llvowlsky.h +++ b/indra/newview/llvowlsky.h @@ -53,7 +53,7 @@ public: void initSunDirection(LLVector3 const & sun_direction, LLVector3 const & sun_angular_velocity); - /*virtual*/ void idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); + /*virtual*/ void idleUpdate(LLAgent &agent, const F64 &time); /*virtual*/ BOOL isActive(void) const; /*virtual*/ LLDrawable * createDrawable(LLPipeline *pipeline); /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); diff --git a/indra/newview/llworldmapview.cpp b/indra/newview/llworldmapview.cpp index ae334d4bd2..786e4f2de6 100755 --- a/indra/newview/llworldmapview.cpp +++ b/indra/newview/llworldmapview.cpp @@ -1595,14 +1595,6 @@ void LLWorldMapView::handleClick(S32 x, S32 y, MASK mask, } -BOOL outside_slop(S32 x, S32 y, S32 start_x, S32 start_y) -{ - S32 dx = x - start_x; - S32 dy = y - start_y; - - return (dx <= -2 || 2 <= dx || dy <= -2 || 2 <= dy); -} - BOOL LLWorldMapView::handleMouseDown( S32 x, S32 y, MASK mask ) { gFocusMgr.setMouseCapture( this ); @@ -1685,7 +1677,7 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask ) { if (hasMouseCapture()) { - if (mPanning || outside_slop(x, y, mMouseDownX, mMouseDownY)) + if (mPanning || llabs(x - mMouseDownX) > 1 || llabs(y - mMouseDownY) > 1) { // just started panning, so hide cursor if (!mPanning) @@ -1702,8 +1694,6 @@ BOOL LLWorldMapView::handleHover( S32 x, S32 y, MASK mask ) sPanY += delta_y; sTargetPanX = sPanX; sTargetPanY = sPanY; - - gViewerWindow->moveCursorToCenter(); } // doesn't matter, cursor should be hidden diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 95a7839337..8f9522c180 100755 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -2397,6 +2397,12 @@ <menu_item_call.on_click function="Advanced.ClickRenderProfile" /> </menu_item_call> + <menu_item_call + label="Benchmark" + name="Benchmark"> + <menu_item_call.on_click + function="Advanced.ClickRenderBenchmark" /> + </menu_item_call> </menu> <menu create_jump_keys="true" |