summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.hgignore5
-rw-r--r--indra/llrender/llrendertarget.cpp26
-rw-r--r--indra/llui/llbutton.cpp51
-rw-r--r--indra/llui/llbutton.h8
-rw-r--r--indra/llui/llfloater.cpp8
-rw-r--r--indra/llui/llfocusmgr.cpp43
-rw-r--r--indra/llui/llfocusmgr.h16
-rw-r--r--indra/llui/lllineeditor.cpp6
-rw-r--r--indra/llui/llmenugl.cpp17
-rw-r--r--indra/llui/llmultislider.cpp37
-rw-r--r--indra/llui/llmultislider.h9
-rw-r--r--indra/llui/llmultisliderctrl.cpp4
-rw-r--r--indra/llui/llpanel.cpp25
-rw-r--r--indra/llui/llpanel.h6
-rw-r--r--indra/llui/llslider.cpp36
-rw-r--r--indra/llui/llslider.h9
-rw-r--r--indra/llui/llsliderctrl.cpp4
-rw-r--r--indra/llui/llspinctrl.cpp6
-rw-r--r--indra/llui/lltabcontainer.cpp6
-rw-r--r--indra/llui/lltextbase.cpp5
-rw-r--r--indra/llui/lluictrl.cpp179
-rw-r--r--indra/llui/lluictrl.h42
-rw-r--r--indra/llxuixml/llinitparam.cpp2
-rw-r--r--indra/llxuixml/llinitparam.h4
-rw-r--r--indra/newview/llagent.cpp6
-rw-r--r--indra/newview/llchiclet.cpp9
-rw-r--r--indra/newview/llfavoritesbar.cpp6
-rw-r--r--indra/newview/llfloaterbuyland.cpp2
-rw-r--r--indra/newview/llfloaterchat.cpp2
-rw-r--r--indra/newview/llfloaterchatterbox.cpp2
-rw-r--r--indra/newview/llfloaterland.cpp2
-rw-r--r--indra/newview/llimpanel.cpp2
-rw-r--r--indra/newview/llmediactrl.cpp2
-rw-r--r--indra/newview/llmoveview.cpp3
-rw-r--r--indra/newview/llnavigationbar.cpp10
-rw-r--r--indra/newview/llnavigationbar.h1
-rw-r--r--indra/newview/llpanelavatartag.cpp2
-rw-r--r--indra/newview/llpanelpeople.cpp2
-rw-r--r--indra/newview/llpreviewgesture.cpp2
-rw-r--r--indra/newview/llsidetray.cpp3
-rw-r--r--indra/newview/llsidetray.h8
-rw-r--r--indra/newview/llviewerwindow.cpp3
-rw-r--r--indra/newview/pipeline.cpp101
-rw-r--r--indra/newview/pipeline.h5
-rw-r--r--indra/newview/skins/default/xui/en/main_view.xml32
45 files changed, 548 insertions, 211 deletions
diff --git a/.hgignore b/.hgignore
index 4d98acf5d9..0f1dd28bcf 100644
--- a/.hgignore
+++ b/.hgignore
@@ -53,3 +53,8 @@ glob:*.cpp.orig
glob:*.cpp.bak
glob:*.h.bak
glob:*.h.orig
+glob:indra/newview/typed_locations.txt
+glob:indra/newview/teleport_history.txt
+glob:indra/newview/search_history.txt
+glob:indra/newview/filters.xml
+glob:indra/newview/avatar_icons_cache.txt
diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp
index f0df3bcf90..bab5cfd56e 100644
--- a/indra/llrender/llrendertarget.cpp
+++ b/indra/llrender/llrendertarget.cpp
@@ -89,19 +89,6 @@ void LLRenderTarget::setSampleBuffer(LLMultisampleBuffer* buffer)
void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, BOOL stencil, LLTexUnit::eTextureType usage, BOOL use_fbo)
{
- // only reallocate if something changed
- if (mResX == resx
- && mResY == resy
- && mUseDepth == depth
- && mStencil == stencil
- && mUsage == usage
- && (mFBO != 0) == ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
- && mColorFmt == color_fmt)
- {
- // nothing to do
- return;
- }
-
stop_glerror();
mResX = resx;
mResY = resy;
@@ -620,19 +607,6 @@ void LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth
void LLMultisampleBuffer::allocate(U32 resx, U32 resy, U32 color_fmt, BOOL depth, BOOL stencil, LLTexUnit::eTextureType usage, BOOL use_fbo, U32 samples )
{
- if (mResX == resx
- && mResY == resy
- && mUseDepth == depth
- && mStencil == stencil
- && mUsage == usage
- && (mFBO != 0) == ((sUseFBO || use_fbo) && gGLManager.mHasFramebufferObject)
- && mColorFmt == color_fmt
- && mSamples == samples)
- {
- // nothing to do
- return;
- }
-
stop_glerror();
mResX = resx;
mResY = resy;
diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp
index b65f248db2..8930e32055 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -147,7 +147,11 @@ LLButton::LLButton(const LLButton::Params& p)
mCommitOnReturn(p.commit_on_return),
mFadeWhenDisabled(FALSE),
mForcePressedState(false),
- mLastDrawCharsCount(0)
+ mLastDrawCharsCount(0),
+ mMouseDownSignal(NULL),
+ mMouseUpSignal(NULL),
+ mHeldDownSignal(NULL)
+
{
static LLUICachedControl<S32> llbutton_orig_h_pad ("UIButtonOrigHPad", 0);
static Params default_params(LLUICtrlFactory::getDefaultParams<LLButton>());
@@ -215,13 +219,28 @@ LLButton::LLButton(const LLButton::Params& p)
}
if (p.click_callback.isProvided())
- initCommitCallback(p.click_callback, mCommitSignal); // alias -> commit_callback
+ {
+ setCommitCallback(initCommitCallback(p.click_callback)); // alias -> commit_callback
+ }
if (p.mouse_down_callback.isProvided())
- initCommitCallback(p.mouse_down_callback, mMouseDownSignal);
+ {
+ setMouseDownCallback(initCommitCallback(p.mouse_down_callback));
+ }
if (p.mouse_up_callback.isProvided())
- initCommitCallback(p.mouse_up_callback, mMouseUpSignal);
+ {
+ setMouseUpCallback(initCommitCallback(p.mouse_up_callback));
+ }
if (p.mouse_held_callback.isProvided())
- initCommitCallback(p.mouse_held_callback, mHeldDownSignal);
+ {
+ setHeldDownCallback(initCommitCallback(p.mouse_held_callback));
+ }
+}
+
+LLButton::~LLButton()
+{
+ delete mMouseDownSignal;
+ delete mMouseUpSignal;
+ delete mHeldDownSignal;
}
// HACK: Committing a button is the same as instantly clicking it.
@@ -232,9 +251,9 @@ void LLButton::onCommit()
// panel containing it. Therefore we need to call LLUICtrl::onCommit()
// LAST, otherwise this becomes deleted memory.
- mMouseDownSignal(this, LLSD());
+ if (mMouseDownSignal) (*mMouseDownSignal)(this, LLSD());
- mMouseUpSignal(this, LLSD());
+ if (mMouseUpSignal) (*mMouseUpSignal)(this, LLSD());
if (getSoundFlags() & MOUSE_DOWN)
{
@@ -257,19 +276,23 @@ void LLButton::onCommit()
boost::signals2::connection LLButton::setClickedCallback( const commit_signal_t::slot_type& cb )
{
- return mCommitSignal.connect(cb);
+ if (!mCommitSignal) mCommitSignal = new commit_signal_t();
+ return mCommitSignal->connect(cb);
}
boost::signals2::connection LLButton::setMouseDownCallback( const commit_signal_t::slot_type& cb )
{
- return mMouseDownSignal.connect(cb);
+ if (!mMouseDownSignal) mMouseDownSignal = new commit_signal_t();
+ return mMouseDownSignal->connect(cb);
}
boost::signals2::connection LLButton::setMouseUpCallback( const commit_signal_t::slot_type& cb )
{
- return mMouseUpSignal.connect(cb);
+ if (!mMouseUpSignal) mMouseUpSignal = new commit_signal_t();
+ return mMouseUpSignal->connect(cb);
}
boost::signals2::connection LLButton::setHeldDownCallback( const commit_signal_t::slot_type& cb )
{
- return mHeldDownSignal.connect(cb);
+ if (!mHeldDownSignal) mHeldDownSignal = new commit_signal_t();
+ return mHeldDownSignal->connect(cb);
}
@@ -351,7 +374,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask)
*/
LLUICtrl::handleMouseDown(x, y, mask);
- mMouseDownSignal(this, LLSD());
+ if(mMouseDownSignal) (*mMouseDownSignal)(this, LLSD());
mMouseDownTimer.start();
mMouseDownFrame = (S32) LLFrameTimer::getFrameCount();
@@ -383,7 +406,7 @@ BOOL LLButton::handleMouseUp(S32 x, S32 y, MASK mask)
LLUICtrl::handleMouseUp(x, y, mask);
// Regardless of where mouseup occurs, handle callback
- mMouseUpSignal(this, LLSD());
+ if(mMouseUpSignal) (*mMouseUpSignal)(this, LLSD());
resetMouseDownTimer();
@@ -493,7 +516,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask)
{
LLSD param;
param["count"] = mMouseHeldDownCount++;
- mHeldDownSignal(this, param);
+ if (mHeldDownSignal) (*mHeldDownSignal)(this, param);
}
}
diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h
index 3c1b57c4be..8c3b4bd859 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -128,6 +128,8 @@ protected:
LLButton(const Params&);
public:
+
+ ~LLButton();
// For backward compatability only
typedef boost::function<void(void*)> button_callback_t;
@@ -251,9 +253,9 @@ private:
void resetMouseDownTimer();
private:
- commit_signal_t mMouseDownSignal;
- commit_signal_t mMouseUpSignal;
- commit_signal_t mHeldDownSignal;
+ commit_signal_t* mMouseDownSignal;
+ commit_signal_t* mMouseUpSignal;
+ commit_signal_t* mHeldDownSignal;
const LLFontGL* mGLFont;
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index bf965e8e28..262afbe661 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -2642,10 +2642,14 @@ void LLFloater::initFromParams(const LLFloater::Params& p)
// open callback
if (p.open_callback.isProvided())
- initCommitCallback(p.open_callback, mOpenSignal);
+ {
+ mOpenSignal.connect(initCommitCallback(p.open_callback));
+ }
// close callback
if (p.close_callback.isProvided())
- initCommitCallback(p.close_callback, mCloseSignal);
+ {
+ mCloseSignal.connect(initCommitCallback(p.close_callback));
+ }
}
LLFastTimer::DeclareTimer POST_BUILD("Floater Post Build");
diff --git a/indra/llui/llfocusmgr.cpp b/indra/llui/llfocusmgr.cpp
index 00a80478cf..35fbc7b0a8 100644
--- a/indra/llui/llfocusmgr.cpp
+++ b/indra/llui/llfocusmgr.cpp
@@ -41,6 +41,10 @@ const F32 FOCUS_FADE_TIME = 0.3f;
// NOTE: the LLFocusableElement implementation has been moved here from lluictrl.cpp.
LLFocusableElement::LLFocusableElement()
+: mFocusLostCallback(NULL),
+ mFocusReceivedCallback(NULL),
+ mFocusChangedCallback(NULL),
+ mTopLostCallback(NULL)
{
}
@@ -59,23 +63,27 @@ BOOL LLFocusableElement::handleUnicodeChar(llwchar uni_char, BOOL called_from_pa
// virtual
LLFocusableElement::~LLFocusableElement()
{
+ delete mFocusLostCallback;
+ delete mFocusReceivedCallback;
+ delete mFocusChangedCallback;
+ delete mTopLostCallback;
}
void LLFocusableElement::onFocusReceived()
{
- mFocusReceivedCallback(this);
- mFocusChangedCallback(this);
+ if (mFocusReceivedCallback) (*mFocusReceivedCallback)(this);
+ if (mFocusChangedCallback) (*mFocusChangedCallback)(this);
}
void LLFocusableElement::onFocusLost()
{
- mFocusLostCallback(this);
- mFocusChangedCallback(this);
+ if (mFocusLostCallback) (*mFocusLostCallback)(this);
+ if (mFocusChangedCallback) (*mFocusChangedCallback)(this);
}
void LLFocusableElement::onTopLost()
{
- mTopLostCallback(this);
+ if (mTopLostCallback) (*mTopLostCallback)(this);
}
BOOL LLFocusableElement::hasFocus() const
@@ -87,6 +95,31 @@ void LLFocusableElement::setFocus(BOOL b)
{
}
+boost::signals2::connection LLFocusableElement::setFocusLostCallback( const focus_signal_t::slot_type& cb)
+{
+ if (!mFocusLostCallback) mFocusLostCallback = new focus_signal_t();
+ return mFocusLostCallback->connect(cb);
+}
+
+boost::signals2::connection LLFocusableElement::setFocusReceivedCallback(const focus_signal_t::slot_type& cb)
+{
+ if (!mFocusReceivedCallback) mFocusReceivedCallback = new focus_signal_t();
+ return mFocusReceivedCallback->connect(cb);
+}
+
+boost::signals2::connection LLFocusableElement::setFocusChangedCallback(const focus_signal_t::slot_type& cb)
+{
+ if (!mFocusChangedCallback) mFocusChangedCallback = new focus_signal_t();
+ return mFocusChangedCallback->connect(cb);
+}
+
+boost::signals2::connection LLFocusableElement::setTopLostCallback(const focus_signal_t::slot_type& cb)
+{
+ if (!mTopLostCallback) mTopLostCallback = new focus_signal_t();
+ return mTopLostCallback->connect(cb);
+}
+
+
LLFocusMgr gFocusMgr;
diff --git a/indra/llui/llfocusmgr.h b/indra/llui/llfocusmgr.h
index 2fa4e124fb..83ecd1d301 100644
--- a/indra/llui/llfocusmgr.h
+++ b/indra/llui/llfocusmgr.h
@@ -56,10 +56,10 @@ public:
typedef boost::signals2::signal<void(LLFocusableElement*)> focus_signal_t;
- boost::signals2::connection setFocusLostCallback( const focus_signal_t::slot_type& cb) { return mFocusLostCallback.connect(cb);}
- boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb) { return mFocusReceivedCallback.connect(cb);}
- boost::signals2::connection setFocusChangedCallback(const focus_signal_t::slot_type& cb) { return mFocusChangedCallback.connect(cb);}
- void setTopLostCallback(const focus_signal_t::slot_type& cb) { mTopLostCallback.connect(cb);}
+ boost::signals2::connection setFocusLostCallback( const focus_signal_t::slot_type& cb);
+ boost::signals2::connection setFocusReceivedCallback(const focus_signal_t::slot_type& cb);
+ boost::signals2::connection setFocusChangedCallback(const focus_signal_t::slot_type& cb);
+ boost::signals2::connection setTopLostCallback(const focus_signal_t::slot_type& cb);
// These were brought up the hierarchy from LLView so that we don't have to use dynamic_cast when dealing with keyboard focus.
virtual BOOL handleKey(KEY key, MASK mask, BOOL called_from_parent);
@@ -69,10 +69,10 @@ protected:
virtual void onFocusReceived();
virtual void onFocusLost();
virtual void onTopLost(); // called when registered as top ctrl and user clicks elsewhere
- focus_signal_t mFocusLostCallback;
- focus_signal_t mFocusReceivedCallback;
- focus_signal_t mFocusChangedCallback;
- focus_signal_t mTopLostCallback;
+ focus_signal_t* mFocusLostCallback;
+ focus_signal_t* mFocusReceivedCallback;
+ focus_signal_t* mFocusChangedCallback;
+ focus_signal_t* mTopLostCallback;
};
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index c2f91ff7e0..406c77a365 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -626,7 +626,8 @@ BOOL LLLineEditor::handleMouseDown(S32 x, S32 y, MASK mask)
// delay cursor flashing
mKeystrokeTimer.reset();
- mMouseDownSignal(this,x,y,mask);
+ if (mMouseDownSignal)
+ (*mMouseDownSignal)(this,x,y,mask);
return TRUE;
}
@@ -742,7 +743,8 @@ BOOL LLLineEditor::handleMouseUp(S32 x, S32 y, MASK mask)
}
// We won't call LLUICtrl::handleMouseUp to avoid double calls of childrenHandleMouseUp().Just invoke the signal manually.
- mMouseUpSignal(this,x,y, mask);
+ if (mMouseUpSignal)
+ (*mMouseUpSignal)(this,x,y, mask);
return handled;
}
diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp
index de9a854f63..f8935d03ac 100644
--- a/indra/llui/llmenugl.cpp
+++ b/indra/llui/llmenugl.cpp
@@ -760,21 +760,25 @@ void LLMenuItemCallGL::initFromParams(const Params& p)
{
if (p.on_visible.isProvided())
{
- initVisibleCallback(p.on_visible, mVisibleSignal);
+ mVisibleSignal.connect(initVisibleCallback(p.on_visible));
}
if (p.on_enable.isProvided())
{
- initEnableCallback(p.on_enable, mEnableSignal);
+ setEnableCallback(initEnableCallback(p.on_enable));
// Set the enabled control variable (for backwards compatability)
if (p.on_enable.control_name.isProvided() && !p.on_enable.control_name().empty())
{
LLControlVariable* control = findControl(p.on_enable.control_name());
if (control)
+ {
setEnabledControlVariable(control);
+ }
}
}
if (p.on_click.isProvided())
- initCommitCallback(p.on_click, mCommitSignal);
+ {
+ setCommitCallback(initCommitCallback(p.on_click));
+ }
LLUICtrl::initFromParams(p);
}
@@ -795,7 +799,10 @@ void LLMenuItemCallGL::updateEnabled( void )
if (mEnabledControlVariable)
{
if (!enabled)
- mEnabledControlVariable->set(false); // callback overrides control variable; this will call setEnabled()
+ {
+ // callback overrides control variable; this will call setEnabled()
+ mEnabledControlVariable->set(false);
+ }
}
else
{
@@ -854,7 +861,7 @@ void LLMenuItemCheckGL::initFromParams(const Params& p)
{
if (p.on_check.isProvided())
{
- initEnableCallback(p.on_check, mCheckSignal);
+ setCheckCallback(initEnableCallback(p.on_check));
// Set the control name (for backwards compatability)
if (p.on_check.control_name.isProvided() && !p.on_check.control_name().empty())
{
diff --git a/indra/llui/llmultislider.cpp b/indra/llui/llmultislider.cpp
index 68e496aed1..1891bca36c 100644
--- a/indra/llui/llmultislider.cpp
+++ b/indra/llui/llmultislider.cpp
@@ -84,17 +84,30 @@ LLMultiSlider::LLMultiSlider(const LLMultiSlider::Params& p)
mThumbCenterSelectedColor(p.thumb_center_selected_color()),
mDisabledThumbColor(p.thumb_disabled_color()),
mTriangleColor(p.triangle_color()),
- mThumbWidth(p.thumb_width)
+ mThumbWidth(p.thumb_width),
+ mMouseDownSignal(NULL),
+ mMouseUpSignal(NULL)
{
mValue.emptyMap();
mCurSlider = LLStringUtil::null;
if (p.mouse_down_callback.isProvided())
- initCommitCallback(p.mouse_down_callback, mMouseDownSignal);
+ {
+ setMouseDownCallback(initCommitCallback(p.mouse_down_callback));
+ }
if (p.mouse_up_callback.isProvided())
- initCommitCallback(p.mouse_up_callback, mMouseUpSignal);
+ {
+ setMouseUpCallback(initCommitCallback(p.mouse_up_callback));
+ }
+}
+
+LLMultiSlider::~LLMultiSlider()
+{
+ delete mMouseDownSignal;
+ delete mMouseUpSignal;
}
+
void LLMultiSlider::setSliderValue(const std::string& name, F32 value, BOOL from_event)
{
// exit if not there
@@ -325,7 +338,8 @@ BOOL LLMultiSlider::handleMouseUp(S32 x, S32 y, MASK mask)
{
gFocusMgr.setMouseCapture( NULL );
- mMouseUpSignal( this, LLSD() );
+ if (mMouseUpSignal)
+ (*mMouseUpSignal)( this, LLSD() );
handled = TRUE;
make_ui_sound("UISndClickRelease");
@@ -345,7 +359,8 @@ BOOL LLMultiSlider::handleMouseDown(S32 x, S32 y, MASK mask)
{
setFocus(TRUE);
}
- mMouseDownSignal( this, LLSD() );
+ if (mMouseDownSignal)
+ (*mMouseDownSignal)( this, LLSD() );
if (MASK_CONTROL & mask) // if CTRL is modifying
{
@@ -557,3 +572,15 @@ void LLMultiSlider::draw()
LLF32UICtrl::draw();
}
+
+boost::signals2::connection LLMultiSlider::setMouseDownCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMouseDownSignal) mMouseDownSignal = new commit_signal_t();
+ return mMouseDownSignal->connect(cb);
+}
+
+boost::signals2::connection LLMultiSlider::setMouseUpCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMouseUpSignal) mMouseUpSignal = new commit_signal_t();
+ return mMouseUpSignal->connect(cb);
+}
diff --git a/indra/llui/llmultislider.h b/indra/llui/llmultislider.h
index da633cc1cd..f8e43a0470 100644
--- a/indra/llui/llmultislider.h
+++ b/indra/llui/llmultislider.h
@@ -67,6 +67,7 @@ protected:
LLMultiSlider(const Params&);
friend class LLUICtrlFactory;
public:
+ virtual ~LLMultiSlider();
void setSliderValue(const std::string& name, F32 value, BOOL from_event = FALSE);
F32 getSliderValue(const std::string& name) const;
@@ -78,8 +79,8 @@ public:
/*virtual*/ void setValue(const LLSD& value);
/*virtual*/ LLSD getValue() const { return mValue; }
- boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); }
- boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); }
+ boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb );
+ boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb );
bool findUnusedValue(F32& initVal);
const std::string& addSlider();
@@ -116,8 +117,8 @@ protected:
LLUIColor mDisabledThumbColor;
LLUIColor mTriangleColor;
- commit_signal_t mMouseDownSignal;
- commit_signal_t mMouseUpSignal;
+ commit_signal_t* mMouseDownSignal;
+ commit_signal_t* mMouseUpSignal;
};
#endif // LL_MULTI_SLIDER_H
diff --git a/indra/llui/llmultisliderctrl.cpp b/indra/llui/llmultisliderctrl.cpp
index a9f462173d..87938c19d4 100644
--- a/indra/llui/llmultisliderctrl.cpp
+++ b/indra/llui/llmultisliderctrl.cpp
@@ -344,7 +344,7 @@ void LLMultiSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata)
if( self->mMultiSlider->getMinValue() <= val && val <= self->mMultiSlider->getMaxValue() )
{
self->setCurSliderValue( val ); // set the value temporarily so that the callback can retrieve it.
- if( self->mValidateSignal( self, val ) )
+ if( !self->mValidateSignal || (*(self->mValidateSignal))( self, val ) )
{
success = TRUE;
}
@@ -378,7 +378,7 @@ void LLMultiSliderCtrl::onSliderCommit(LLUICtrl* ctrl, const LLSD& userdata)
F32 new_val = self->mMultiSlider->getCurSliderValue();
self->mCurValue = new_val; // set the value temporarily so that the callback can retrieve it.
- if( self->mValidateSignal( self, new_val ) )
+ if( !self->mValidateSignal || (*(self->mValidateSignal))( self, new_val ) )
{
success = TRUE;
}
diff --git a/indra/llui/llpanel.cpp b/indra/llui/llpanel.cpp
index 89c4656297..063822dd56 100644
--- a/indra/llui/llpanel.cpp
+++ b/indra/llui/llpanel.cpp
@@ -106,7 +106,8 @@ LLPanel::LLPanel(const LLPanel::Params& p)
mHelpTopic(p.help_topic),
mCommitCallbackRegistrar(false),
mEnableCallbackRegistrar(false),
- mXMLFilename(p.filename)
+ mXMLFilename(p.filename),
+ mVisibleSignal(NULL)
// *NOTE: Be sure to also change LLPanel::initFromParams(). We have too
// many classes derived from LLPanel to retrofit them all to pass in params.
{
@@ -118,6 +119,11 @@ LLPanel::LLPanel(const LLPanel::Params& p)
mPanelHandle.bind(this);
}
+LLPanel::~LLPanel()
+{
+ delete mVisibleSignal;
+}
+
// virtual
BOOL LLPanel::isPanel() const
{
@@ -332,7 +338,8 @@ BOOL LLPanel::handleKeyHere( KEY key, MASK mask )
void LLPanel::handleVisibilityChange ( BOOL new_visibility )
{
LLUICtrl::handleVisibilityChange ( new_visibility );
- mVisibleSignal(this, LLSD(new_visibility) ); // Pass BOOL as LLSD
+ if (mVisibleSignal)
+ (*mVisibleSignal)(this, LLSD(new_visibility) ); // Pass BOOL as LLSD
}
void LLPanel::setFocus(BOOL b)
@@ -424,7 +431,9 @@ void LLPanel::initFromParams(const LLPanel::Params& p)
// visible callback
if (p.visible_callback.isProvided())
- initCommitCallback(p.visible_callback, mVisibleSignal);
+ {
+ setVisibleCallback(initCommitCallback(p.visible_callback));
+ }
for (LLInitParam::ParamIterator<LocalizedString>::const_iterator it = p.strings().begin();
it != p.strings().end();
@@ -907,3 +916,13 @@ void LLPanel::childSetControlName(const std::string& id, const std::string& cont
view->setControlName(control_name, NULL);
}
}
+
+boost::signals2::connection LLPanel::setVisibleCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mVisibleSignal)
+ {
+ mVisibleSignal = new commit_signal_t();
+ }
+
+ return mVisibleSignal->connect(cb);
+}
diff --git a/indra/llui/llpanel.h b/indra/llui/llpanel.h
index c213809d68..0a0fed82fb 100644
--- a/indra/llui/llpanel.h
+++ b/indra/llui/llpanel.h
@@ -109,7 +109,7 @@ protected:
public:
// LLPanel(const std::string& name, const LLRect& rect = LLRect(), BOOL bordered = TRUE);
- /*virtual*/ ~LLPanel() {}
+ /*virtual*/ ~LLPanel();
// LLView interface
/*virtual*/ BOOL isPanel() const;
@@ -241,6 +241,8 @@ public:
void setXMLFilename(std::string filename) { mXMLFilename = filename; };
std::string getXMLFilename() { return mXMLFilename; };
+ boost::signals2::connection setVisibleCallback( const commit_signal_t::slot_type& cb );
+
protected:
// Override to set not found list
LLButton* getDefaultButton() { return mDefaultBtn; }
@@ -249,7 +251,7 @@ protected:
EnableCallbackRegistry::ScopedRegistrar mEnableCallbackRegistrar;
VisibleCallbackRegistry::ScopedRegistrar mVisibleCallbackRegistrar;
- commit_signal_t mVisibleSignal; // Called when visibility changes, passes new visibility as LLSD()
+ commit_signal_t* mVisibleSignal; // Called when visibility changes, passes new visibility as LLSD()
std::string mHelpTopic; // the name of this panel's help topic to display in the Help Viewer
diff --git a/indra/llui/llslider.cpp b/indra/llui/llslider.cpp
index da2fc7c68b..a6f729b396 100644
--- a/indra/llui/llslider.cpp
+++ b/indra/llui/llslider.cpp
@@ -77,7 +77,9 @@ LLSlider::LLSlider(const LLSlider::Params& p)
mTrackImageHorizontal(p.track_image_horizontal),
mTrackImageVertical(p.track_image_vertical),
mTrackHighlightHorizontalImage(p.track_highlight_horizontal_image),
- mTrackHighlightVerticalImage(p.track_highlight_vertical_image)
+ mTrackHighlightVerticalImage(p.track_highlight_vertical_image),
+ mMouseDownSignal(NULL),
+ mMouseUpSignal(NULL)
{
mViewModel->setValue(p.initial_value);
updateThumbRect();
@@ -86,9 +88,19 @@ LLSlider::LLSlider(const LLSlider::Params& p)
setValue(getValueF32());
if (p.mouse_down_callback.isProvided())
- initCommitCallback(p.mouse_down_callback, mMouseDownSignal);
+ {
+ setMouseDownCallback(initCommitCallback(p.mouse_down_callback));
+ }
if (p.mouse_up_callback.isProvided())
- initCommitCallback(p.mouse_up_callback, mMouseUpSignal);
+ {
+ setMouseUpCallback(initCommitCallback(p.mouse_up_callback));
+ }
+}
+
+LLSlider::~LLSlider()
+{
+ delete mMouseDownSignal;
+ delete mMouseUpSignal;
}
void LLSlider::setValue(F32 value, BOOL from_event)
@@ -202,7 +214,8 @@ BOOL LLSlider::handleMouseUp(S32 x, S32 y, MASK mask)
{
gFocusMgr.setMouseCapture( NULL );
- mMouseUpSignal( this, getValueF32() );
+ if (mMouseUpSignal)
+ (*mMouseUpSignal)( this, getValueF32() );
handled = TRUE;
make_ui_sound("UISndClickRelease");
@@ -222,7 +235,8 @@ BOOL LLSlider::handleMouseDown(S32 x, S32 y, MASK mask)
{
setFocus(TRUE);
}
- mMouseDownSignal( this, getValueF32() );
+ if (mMouseDownSignal)
+ (*mMouseDownSignal)( this, getValueF32() );
if (MASK_CONTROL & mask) // if CTRL is modifying
{
@@ -364,3 +378,15 @@ void LLSlider::draw()
LLUICtrl::draw();
}
+
+boost::signals2::connection LLSlider::setMouseDownCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMouseDownSignal) mMouseDownSignal = new commit_signal_t();
+ return mMouseDownSignal->connect(cb);
+}
+
+boost::signals2::connection LLSlider::setMouseUpCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMouseUpSignal) mMouseUpSignal = new commit_signal_t();
+ return mMouseUpSignal->connect(cb);
+}
diff --git a/indra/llui/llslider.h b/indra/llui/llslider.h
index 6ab0ed7922..45f8f81e40 100644
--- a/indra/llui/llslider.h
+++ b/indra/llui/llslider.h
@@ -67,6 +67,7 @@ protected:
LLSlider(const Params&);
friend class LLUICtrlFactory;
public:
+ virtual ~LLSlider();
void setValue( F32 value, BOOL from_event = FALSE );
// overrides for LLF32UICtrl methods
virtual void setValue(const LLSD& value ) { setValue((F32)value.asReal(), TRUE); }
@@ -76,8 +77,8 @@ public:
virtual void setMinValue(F32 min_value) { LLF32UICtrl::setMinValue(min_value); updateThumbRect(); }
virtual void setMaxValue(F32 max_value) { LLF32UICtrl::setMaxValue(max_value); updateThumbRect(); }
- boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); }
- boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); }
+ boost::signals2::connection setMouseDownCallback( const commit_signal_t::slot_type& cb );
+ boost::signals2::connection setMouseUpCallback( const commit_signal_t::slot_type& cb );
virtual BOOL handleHover(S32 x, S32 y, MASK mask);
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask);
@@ -109,8 +110,8 @@ private:
LLUIColor mThumbOutlineColor;
LLUIColor mThumbCenterColor;
- commit_signal_t mMouseDownSignal;
- commit_signal_t mMouseUpSignal;
+ commit_signal_t* mMouseDownSignal;
+ commit_signal_t* mMouseUpSignal;
};
#endif // LL_LLSLIDER_H
diff --git a/indra/llui/llsliderctrl.cpp b/indra/llui/llsliderctrl.cpp
index ed22c0a47f..a4f89ae1d3 100644
--- a/indra/llui/llsliderctrl.cpp
+++ b/indra/llui/llsliderctrl.cpp
@@ -260,7 +260,7 @@ void LLSliderCtrl::onEditorCommit( LLUICtrl* ctrl, const LLSD& userdata )
if( self->mSlider->getMinValue() <= val && val <= self->mSlider->getMaxValue() )
{
self->setValue( val ); // set the value temporarily so that the callback can retrieve it.
- if( self->mValidateSignal( self, val ) )
+ if( !self->mValidateSignal || (*(self->mValidateSignal))( self, val ) )
{
success = TRUE;
}
@@ -294,7 +294,7 @@ void LLSliderCtrl::onSliderCommit( LLUICtrl* ctrl, const LLSD& userdata )
F32 new_val = self->mSlider->getValueF32();
self->mValue = new_val; // set the value temporarily so that the callback can retrieve it.
- if( self->mValidateSignal( self, new_val ) )
+ if( !self->mValidateSignal || (*(self->mValidateSignal))( self, new_val ) )
{
success = TRUE;
}
diff --git a/indra/llui/llspinctrl.cpp b/indra/llui/llspinctrl.cpp
index bedf16a397..d6d46654d5 100644
--- a/indra/llui/llspinctrl.cpp
+++ b/indra/llui/llspinctrl.cpp
@@ -190,7 +190,7 @@ void LLSpinCtrl::onUpBtn( const LLSD& data )
F32 saved_val = (F32)getValue().asReal();
setValue(val);
- if( !mValidateSignal( this, val ) )
+ if( mValidateSignal && !(*mValidateSignal)( this, val ) )
{
setValue( saved_val );
reportInvalidData();
@@ -224,7 +224,7 @@ void LLSpinCtrl::onDownBtn( const LLSD& data )
F32 saved_val = (F32)getValue().asReal();
setValue(val);
- if( !mValidateSignal( this, val ) )
+ if( mValidateSignal && !(*mValidateSignal)( this, val ) )
{
setValue( saved_val );
reportInvalidData();
@@ -316,7 +316,7 @@ void LLSpinCtrl::onEditorCommit( const LLSD& data )
F32 saved_val = getValueF32();
setValue(val);
- if( mValidateSignal( this, val ) )
+ if( !mValidateSignal || (*mValidateSignal)( this, val ) )
{
success = TRUE;
onCommit();
diff --git a/indra/llui/lltabcontainer.cpp b/indra/llui/lltabcontainer.cpp
index f5d8174820..d7d61cf6cb 100644
--- a/indra/llui/lltabcontainer.cpp
+++ b/indra/llui/lltabcontainer.cpp
@@ -1339,12 +1339,12 @@ BOOL LLTabContainer::selectTab(S32 which)
cbdata = selected_tuple->mTabPanel->getName();
BOOL res = FALSE;
- if( mValidateSignal( this, cbdata ) )
+ if( !mValidateSignal || (*mValidateSignal)( this, cbdata ) )
{
res = setTab(which);
- if (res)
+ if (res && mCommitSignal)
{
- mCommitSignal(this, cbdata);
+ (*mCommitSignal)(this, cbdata);
}
}
diff --git a/indra/llui/lltextbase.cpp b/indra/llui/lltextbase.cpp
index e210667764..3619b36c0d 100644
--- a/indra/llui/lltextbase.cpp
+++ b/indra/llui/lltextbase.cpp
@@ -60,6 +60,11 @@ LLTextBase::line_info::line_info(S32 index_start, S32 index_end, LLRect rect, S3
bool LLTextBase::compare_segment_end::operator()(const LLTextSegmentPtr& a, const LLTextSegmentPtr& b) const
{
+ // sort empty spans (e.g. 11-11) after previous non-empty spans (e.g. 5-11)
+ if (a->getEnd() == b->getEnd())
+ {
+ return a->getStart() < b->getStart();
+ }
return a->getEnd() < b->getEnd();
}
diff --git a/indra/llui/lluictrl.cpp b/indra/llui/lluictrl.cpp
index 08fc8fb784..a30d5b4651 100644
--- a/indra/llui/lluictrl.cpp
+++ b/indra/llui/lluictrl.cpp
@@ -78,7 +78,16 @@ LLUICtrl::LLUICtrl(const LLUICtrl::Params& p, const LLViewModelPtr& viewmodel)
mEnabledControlVariable(NULL),
mDisabledControlVariable(NULL),
mMakeVisibleControlVariable(NULL),
- mMakeInvisibleControlVariable(NULL)
+ mMakeInvisibleControlVariable(NULL),
+ mCommitSignal(NULL),
+ mValidateSignal(NULL),
+ mMouseEnterSignal(NULL),
+ mMouseLeaveSignal(NULL),
+ mMouseDownSignal(NULL),
+ mMouseUpSignal(NULL),
+ mRightMouseDownSignal(NULL),
+ mRightMouseUpSignal(NULL),
+ mDoubleClickSignal(NULL)
{
mUICtrlHandle.bind(this);
}
@@ -129,10 +138,14 @@ void LLUICtrl::initFromParams(const Params& p)
}
if (p.commit_callback.isProvided())
- initCommitCallback(p.commit_callback, mCommitSignal);
+ {
+ setCommitCallback(initCommitCallback(p.commit_callback));
+ }
if (p.validate_callback.isProvided())
- initEnableCallback(p.validate_callback, mValidateSignal);
+ {
+ setValidateCallback(initEnableCallback(p.validate_callback));
+ }
if (p.init_callback.isProvided())
{
@@ -151,10 +164,14 @@ void LLUICtrl::initFromParams(const Params& p)
}
if(p.mouseenter_callback.isProvided())
- initCommitCallback(p.mouseenter_callback, mMouseEnterSignal);
+ {
+ setMouseEnterCallback(initCommitCallback(p.mouseenter_callback));
+ }
if(p.mouseleave_callback.isProvided())
- initCommitCallback(p.mouseleave_callback, mMouseLeaveSignal);
+ {
+ setMouseLeaveCallback(initCommitCallback(p.mouseleave_callback));
+ }
}
@@ -167,16 +184,40 @@ LLUICtrl::~LLUICtrl()
llwarns << "UI Control holding top ctrl deleted: " << getName() << ". Top view removed." << llendl;
gFocusMgr.removeTopCtrlWithoutCallback( this );
}
+
+ delete mCommitSignal;
+ delete mValidateSignal;
+ delete mMouseEnterSignal;
+ delete mMouseLeaveSignal;
+ delete mMouseDownSignal;
+ delete mMouseUpSignal;
+ delete mRightMouseDownSignal;
+ delete mRightMouseUpSignal;
+ delete mDoubleClickSignal;
}
-void LLUICtrl::initCommitCallback(const CommitCallbackParam& cb, commit_signal_t& sig)
+void default_commit_handler(LLUICtrl* ctrl, const LLSD& param)
+{}
+
+bool default_enable_handler(LLUICtrl* ctrl, const LLSD& param)
+{
+ return true;
+}
+
+bool default_visible_handler(LLUICtrl* ctrl, const LLSD& param)
+{
+ return true;
+}
+
+
+LLUICtrl::commit_signal_t::slot_type LLUICtrl::initCommitCallback(const CommitCallbackParam& cb)
{
if (cb.function.isProvided())
{
if (cb.parameter.isProvided())
- sig.connect(boost::bind(cb.function(), _1, cb.parameter));
+ return boost::bind(cb.function(), _1, cb.parameter);
else
- sig.connect(cb.function());
+ return cb.function();
}
else
{
@@ -185,26 +226,27 @@ void LLUICtrl::initCommitCallback(const CommitCallbackParam& cb, commit_signal_t
if (func)
{
if (cb.parameter.isProvided())
- sig.connect(boost::bind((*func), _1, cb.parameter));
+ return boost::bind((*func), _1, cb.parameter);
else
- sig.connect(*func);
+ return commit_signal_t::slot_type(*func);
}
else if (!function_name.empty())
{
llwarns << "No callback found for: '" << function_name << "' in control: " << getName() << llendl;
}
}
+ return default_commit_handler;
}
-void LLUICtrl::initEnableCallback(const EnableCallbackParam& cb, enable_signal_t& sig)
+LLUICtrl::enable_signal_t::slot_type LLUICtrl::initEnableCallback(const EnableCallbackParam& cb)
{
// Set the callback function
if (cb.function.isProvided())
{
if (cb.parameter.isProvided())
- sig.connect(boost::bind(cb.function(), this, cb.parameter));
+ return boost::bind(cb.function(), this, cb.parameter);
else
- sig.connect(cb.function());
+ return cb.function();
}
else
{
@@ -212,22 +254,23 @@ void LLUICtrl::initEnableCallback(const EnableCallbackParam& cb, enable_signal_t
if (func)
{
if (cb.parameter.isProvided())
- sig.connect(boost::bind((*func), this, cb.parameter));
+ return boost::bind((*func), this, cb.parameter);
else
- sig.connect(*func);
+ return enable_signal_t::slot_type(*func);
}
}
+ return default_enable_handler;
}
-void LLUICtrl::initVisibleCallback(const VisibleCallbackParam& cb, visible_signal_t& sig)
+LLUICtrl::visible_signal_t::slot_type LLUICtrl::initVisibleCallback(const VisibleCallbackParam& cb)
{
// Set the callback function
if (cb.function.isProvided())
{
if (cb.parameter.isProvided())
- sig.connect(boost::bind(cb.function(), this, cb.parameter));
+ return boost::bind(cb.function(), this, cb.parameter);
else
- sig.connect(cb.function());
+ return cb.function();
}
else
{
@@ -235,30 +278,40 @@ void LLUICtrl::initVisibleCallback(const VisibleCallbackParam& cb, visible_signa
if (func)
{
if (cb.parameter.isProvided())
- sig.connect(boost::bind((*func), this, cb.parameter));
+ return boost::bind((*func), this, cb.parameter);
else
- sig.connect(*func);
+ return visible_signal_t::slot_type(*func);
}
}
+ return default_visible_handler;
}
// virtual
void LLUICtrl::onMouseEnter(S32 x, S32 y, MASK mask)
{
- mMouseEnterSignal(this, getValue());
+ if (mMouseEnterSignal)
+ {
+ (*mMouseEnterSignal)(this, getValue());
+ }
}
// virtual
void LLUICtrl::onMouseLeave(S32 x, S32 y, MASK mask)
{
- mMouseLeaveSignal(this, getValue());
+ if(mMouseLeaveSignal)
+ {
+ (*mMouseLeaveSignal)(this, getValue());
+ }
}
//virtual
BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = LLView::handleMouseDown(x,y,mask);
- mMouseDownSignal(this,x,y,mask);
+ if (mMouseDownSignal)
+ {
+ (*mMouseDownSignal)(this,x,y,mask);
+ }
return handled;
}
@@ -266,7 +319,10 @@ BOOL LLUICtrl::handleMouseDown(S32 x, S32 y, MASK mask)
BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
{
BOOL handled = LLView::handleMouseUp(x,y,mask);
- mMouseUpSignal(this,x,y,mask);
+ if (mMouseUpSignal)
+ {
+ (*mMouseUpSignal)(this,x,y,mask);
+ }
return handled;
}
@@ -274,7 +330,10 @@ BOOL LLUICtrl::handleMouseUp(S32 x, S32 y, MASK mask)
BOOL LLUICtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
{
BOOL handled = LLView::handleRightMouseDown(x,y,mask);
- mRightMouseDownSignal(this,x,y,mask);
+ if (mRightMouseDownSignal)
+ {
+ (*mRightMouseDownSignal)(this,x,y,mask);
+ }
return handled;
}
@@ -282,14 +341,20 @@ BOOL LLUICtrl::handleRightMouseDown(S32 x, S32 y, MASK mask)
BOOL LLUICtrl::handleRightMouseUp(S32 x, S32 y, MASK mask)
{
BOOL handled = LLView::handleRightMouseUp(x,y,mask);
- mRightMouseUpSignal(this,x,y,mask);
+ if(mRightMouseUpSignal)
+ {
+ (*mRightMouseUpSignal)(this,x,y,mask);
+ }
return handled;
}
BOOL LLUICtrl::handleDoubleClick(S32 x, S32 y, MASK mask)
{
BOOL handled = LLView::handleDoubleClick(x, y, mask);
- mDoubleClickSignal(this, x, y, mask);
+ if (mDoubleClickSignal)
+ {
+ (*mDoubleClickSignal)(this, x, y, mask);
+ }
return handled;
}
@@ -302,7 +367,8 @@ BOOL LLUICtrl::canFocusChildren() const
void LLUICtrl::onCommit()
{
- mCommitSignal(this, getValue());
+ if (mCommitSignal)
+ (*mCommitSignal)(this, getValue());
}
//virtual
@@ -832,7 +898,8 @@ boost::signals2::connection LLUICtrl::setCommitCallback( boost::function<void (L
}
boost::signals2::connection LLUICtrl::setValidateBeforeCommit( boost::function<bool (const LLSD& data)> cb )
{
- return mValidateSignal.connect(boost::bind(cb, _2));
+ if (!mValidateSignal) mValidateSignal = new enable_signal_t();
+ return mValidateSignal->connect(boost::bind(cb, _2));
}
// virtual
@@ -850,3 +917,57 @@ BOOL LLUICtrl::getTentative() const
// virtual
void LLUICtrl::setColor(const LLColor4& color)
{ }
+
+boost::signals2::connection LLUICtrl::setCommitCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mCommitSignal) mCommitSignal = new commit_signal_t();
+ return mCommitSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setValidateCallback( const enable_signal_t::slot_type& cb )
+{
+ if (!mValidateSignal) mValidateSignal = new enable_signal_t();
+ return mValidateSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setMouseEnterCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMouseEnterSignal) mMouseEnterSignal = new commit_signal_t();
+ return mMouseEnterSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setMouseLeaveCallback( const commit_signal_t::slot_type& cb )
+{
+ if (!mMouseLeaveSignal) mMouseLeaveSignal = new commit_signal_t();
+ return mMouseLeaveSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setMouseDownCallback( const mouse_signal_t::slot_type& cb )
+{
+ if (!mMouseDownSignal) mMouseDownSignal = new mouse_signal_t();
+ return mMouseDownSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setMouseUpCallback( const mouse_signal_t::slot_type& cb )
+{
+ if (!mMouseUpSignal) mMouseUpSignal = new mouse_signal_t();
+ return mMouseUpSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setRightMouseDownCallback( const mouse_signal_t::slot_type& cb )
+{
+ if (!mRightMouseDownSignal) mRightMouseDownSignal = new mouse_signal_t();
+ return mRightMouseDownSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setRightMouseUpCallback( const mouse_signal_t::slot_type& cb )
+{
+ if (!mRightMouseUpSignal) mRightMouseUpSignal = new mouse_signal_t();
+ return mRightMouseUpSignal->connect(cb);
+}
+
+boost::signals2::connection LLUICtrl::setDoubleClickCallback( const mouse_signal_t::slot_type& cb )
+{
+ if (!mDoubleClickSignal) mDoubleClickSignal = new mouse_signal_t();
+ return mDoubleClickSignal->connect(cb);
+}
diff --git a/indra/llui/lluictrl.h b/indra/llui/lluictrl.h
index dd22851100..aef1bcd519 100644
--- a/indra/llui/lluictrl.h
+++ b/indra/llui/lluictrl.h
@@ -162,9 +162,9 @@ protected:
LLUICtrl(const Params& p = getDefaultParams(),
const LLViewModelPtr& viewmodel=LLViewModelPtr(new LLViewModel));
- void initCommitCallback(const CommitCallbackParam& cb, commit_signal_t& sig);
- void initEnableCallback(const EnableCallbackParam& cb, enable_signal_t& sig);
- void initVisibleCallback(const VisibleCallbackParam& cb, visible_signal_t& sig);
+ commit_signal_t::slot_type initCommitCallback(const CommitCallbackParam& cb);
+ enable_signal_t::slot_type initEnableCallback(const EnableCallbackParam& cb);
+ visible_signal_t::slot_type initVisibleCallback(const VisibleCallbackParam& cb);
// We need this virtual so we can override it with derived versions
virtual LLViewModel* getViewModel() const;
@@ -254,18 +254,18 @@ public:
// topic then put in help_topic_out
bool findHelpTopic(std::string& help_topic_out);
- boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb ) { return mCommitSignal.connect(cb); }
- boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb ) { return mValidateSignal.connect(cb); }
+ boost::signals2::connection setCommitCallback( const commit_signal_t::slot_type& cb );
+ boost::signals2::connection setValidateCallback( const enable_signal_t::slot_type& cb );
- boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb ) { return mMouseEnterSignal.connect(cb); }
- boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb ) { return mMouseLeaveSignal.connect(cb); }
+ boost::signals2::connection setMouseEnterCallback( const commit_signal_t::slot_type& cb );
+ boost::signals2::connection setMouseLeaveCallback( const commit_signal_t::slot_type& cb );
- boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb ) { return mMouseDownSignal.connect(cb); }
- boost::signals2::connection setMouseUpCallback( const mouse_signal_t::slot_type& cb ) { return mMouseUpSignal.connect(cb); }
- boost::signals2::connection setRightMouseDownCallback( const mouse_signal_t::slot_type& cb ) { return mRightMouseDownSignal.connect(cb); }
- boost::signals2::connection setRightMouseUpCallback( const mouse_signal_t::slot_type& cb ) { return mRightMouseUpSignal.connect(cb); }
+ boost::signals2::connection setMouseDownCallback( const mouse_signal_t::slot_type& cb );
+ boost::signals2::connection setMouseUpCallback( const mouse_signal_t::slot_type& cb );
+ boost::signals2::connection setRightMouseDownCallback( const mouse_signal_t::slot_type& cb );
+ boost::signals2::connection setRightMouseUpCallback( const mouse_signal_t::slot_type& cb );
- boost::signals2::connection setDoubleClickCallback( const mouse_signal_t::slot_type& cb ) { return mDoubleClickSignal.connect(cb); }
+ boost::signals2::connection setDoubleClickCallback( const mouse_signal_t::slot_type& cb );
// *TODO: Deprecate; for backwards compatability only:
boost::signals2::connection setCommitCallback( boost::function<void (LLUICtrl*,void*)> cb, void* data);
@@ -293,18 +293,18 @@ protected:
static bool controlListener(const LLSD& newvalue, LLHandle<LLUICtrl> handle, std::string type);
- commit_signal_t mCommitSignal;
- enable_signal_t mValidateSignal;
+ commit_signal_t* mCommitSignal;
+ enable_signal_t* mValidateSignal;
- commit_signal_t mMouseEnterSignal;
- commit_signal_t mMouseLeaveSignal;
+ commit_signal_t* mMouseEnterSignal;
+ commit_signal_t* mMouseLeaveSignal;
- mouse_signal_t mMouseDownSignal;
- mouse_signal_t mMouseUpSignal;
- mouse_signal_t mRightMouseDownSignal;
- mouse_signal_t mRightMouseUpSignal;
+ mouse_signal_t* mMouseDownSignal;
+ mouse_signal_t* mMouseUpSignal;
+ mouse_signal_t* mRightMouseDownSignal;
+ mouse_signal_t* mRightMouseUpSignal;
- mouse_signal_t mDoubleClickSignal;
+ mouse_signal_t* mDoubleClickSignal;
LLViewModelPtr mViewModel;
diff --git a/indra/llxuixml/llinitparam.cpp b/indra/llxuixml/llinitparam.cpp
index 318a0348a2..4c050844f8 100644
--- a/indra/llxuixml/llinitparam.cpp
+++ b/indra/llxuixml/llinitparam.cpp
@@ -46,7 +46,7 @@ namespace LLInitParam
{
const U8* my_addr = reinterpret_cast<const U8*>(this);
const U8* block_addr = reinterpret_cast<const U8*>(enclosing_block);
- mEnclosingBlockOffset = (S16)(block_addr - my_addr);
+ mEnclosingBlockOffset = (U16)(my_addr - block_addr);
}
//
diff --git a/indra/llxuixml/llinitparam.h b/indra/llxuixml/llinitparam.h
index 9fb464ca7b..493ddaa378 100644
--- a/indra/llxuixml/llinitparam.h
+++ b/indra/llxuixml/llinitparam.h
@@ -300,14 +300,14 @@ namespace LLInitParam
const U8* my_addr = reinterpret_cast<const U8*>(this);
// get address of enclosing BLOCK class using stored offset to enclosing BaseBlock class
return *const_cast<BaseBlock*>(
- reinterpret_cast<const BaseBlock*>(my_addr + (ptrdiff_t)mEnclosingBlockOffset));
+ reinterpret_cast<const BaseBlock*>(my_addr - (ptrdiff_t)(S32)mEnclosingBlockOffset));
}
private:
friend class BaseBlock;
bool mIsProvided;
- S16 mEnclosingBlockOffset;
+ U16 mEnclosingBlockOffset;
};
// various callbacks and constraints associated with an individual param
diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp
index 4dd569e2fa..eb5d172ff7 100644
--- a/indra/newview/llagent.cpp
+++ b/indra/newview/llagent.cpp
@@ -2795,7 +2795,8 @@ void LLAgent::endAnimationUpdateUI()
LLBottomTray::getInstance()->setVisible(TRUE);
- LLSideTray::getInstance()->setVisible(TRUE);
+ LLSideTray::getInstance()->getButtonsPanel()->setVisible(TRUE);
+ LLSideTray::getInstance()->updateSidetrayVisibility();
LLPanelStandStopFlying::getInstance()->setVisible(TRUE);
@@ -2893,7 +2894,8 @@ void LLAgent::endAnimationUpdateUI()
LLBottomTray::getInstance()->setVisible(FALSE);
- LLSideTray::getInstance()->setVisible(FALSE);
+ LLSideTray::getInstance()->getButtonsPanel()->setVisible(FALSE);
+ LLSideTray::getInstance()->updateSidetrayVisibility();
LLPanelStandStopFlying::getInstance()->setVisible(FALSE);
diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp
index 9845664c74..5fd4dcd343 100644
--- a/indra/newview/llchiclet.cpp
+++ b/indra/newview/llchiclet.cpp
@@ -163,7 +163,7 @@ LLChiclet::~LLChiclet()
boost::signals2::connection LLChiclet::setLeftButtonClickCallback(
const commit_callback_t& cb)
{
- return mCommitSignal.connect(cb);
+ return setCommitCallback(cb);
}
BOOL LLChiclet::handleMouseDown(S32 x, S32 y, MASK mask)
@@ -972,7 +972,10 @@ void LLChicletPanel::onChicletSizeChanged(LLChiclet* ctrl, const LLSD& param)
void LLChicletPanel::onChicletClick(LLUICtrl*ctrl,const LLSD&param)
{
- mCommitSignal(ctrl,param);
+ if (mCommitSignal)
+ {
+ (*mCommitSignal)(ctrl,param);
+ }
}
void LLChicletPanel::removeChiclet(chiclet_list_t::iterator it)
@@ -1277,7 +1280,7 @@ void LLChicletPanel::onRightScrollHeldDown()
boost::signals2::connection LLChicletPanel::setChicletClickedCallback(
const commit_callback_t& cb)
{
- return mCommitSignal.connect(cb);
+ return setCommitCallback(cb);
}
BOOL LLChicletPanel::handleScrollWheel(S32 x, S32 y, S32 clicks)
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index ae5be8cc7c..8406ddeeca 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -232,13 +232,15 @@ public:
virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask)
{
- mMouseDownSignal(this, x, y, mask);
+ if (mMouseDownSignal)
+ (*mMouseDownSignal)(this, x, y, mask);
return LLMenuItemCallGL::handleMouseDown(x, y, mask);
}
virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask)
{
- mMouseUpSignal(this, x, y, mask);
+ if (mMouseUpSignal)
+ (*mMouseUpSignal)(this, x, y, mask);
return LLMenuItemCallGL::handleMouseUp(x, y, mask);
}
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 467796b4a3..976aaf8044 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -903,7 +903,7 @@ void LLFloaterBuyLandUI::tellUserError(
// virtual
BOOL LLFloaterBuyLandUI::postBuild()
{
- mVisibleSignal.connect(boost::bind(&LLFloaterBuyLandUI::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFloaterBuyLandUI::onVisibilityChange, this, _2));
mCurrency.prepare();
diff --git a/indra/newview/llfloaterchat.cpp b/indra/newview/llfloaterchat.cpp
index 58025ef78b..57bb93d81a 100644
--- a/indra/newview/llfloaterchat.cpp
+++ b/indra/newview/llfloaterchat.cpp
@@ -129,7 +129,7 @@ void LLFloaterChat::draw()
BOOL LLFloaterChat::postBuild()
{
// Hide the chat overlay when our history is visible.
- mVisibleSignal.connect(boost::bind(&LLFloaterChat::updateConsoleVisibility, this));
+ setVisibleCallback(boost::bind(&LLFloaterChat::updateConsoleVisibility, this));
mPanel = (LLPanelActiveSpeakers*)getChild<LLPanel>("active_speakers_panel");
diff --git a/indra/newview/llfloaterchatterbox.cpp b/indra/newview/llfloaterchatterbox.cpp
index fbf09207fe..1b14ca573a 100644
--- a/indra/newview/llfloaterchatterbox.cpp
+++ b/indra/newview/llfloaterchatterbox.cpp
@@ -114,7 +114,7 @@ LLFloaterChatterBox::~LLFloaterChatterBox()
BOOL LLFloaterChatterBox::postBuild()
{
- mVisibleSignal.connect(boost::bind(&LLFloaterChatterBox::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFloaterChatterBox::onVisibilityChange, this, _2));
if (gSavedSettings.getBOOL("ContactsTornOff"))
{
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 22d6098d5b..d855ab1dfa 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -239,7 +239,7 @@ LLFloaterLand::LLFloaterLand(const LLSD& seed)
BOOL LLFloaterLand::postBuild()
{
- mVisibleSignal.connect(boost::bind(&LLFloaterLand::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFloaterLand::onVisibilityChange, this, _2));
LLTabContainer* tab = getChild<LLTabContainer>("landtab");
diff --git a/indra/newview/llimpanel.cpp b/indra/newview/llimpanel.cpp
index 87b801d73b..e6ded5f371 100644
--- a/indra/newview/llimpanel.cpp
+++ b/indra/newview/llimpanel.cpp
@@ -216,7 +216,7 @@ LLFloaterIMPanel::~LLFloaterIMPanel()
BOOL LLFloaterIMPanel::postBuild()
{
- mVisibleSignal.connect(boost::bind(&LLFloaterIMPanel::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLFloaterIMPanel::onVisibilityChange, this, _2));
mInputEditor = getChild<LLLineEditor>("chat_editor");
mInputEditor->setFocusReceivedCallback( boost::bind(onInputEditorFocusReceived, _1, this) );
diff --git a/indra/newview/llmediactrl.cpp b/indra/newview/llmediactrl.cpp
index 5cd40273f6..2376a3581d 100644
--- a/indra/newview/llmediactrl.cpp
+++ b/indra/newview/llmediactrl.cpp
@@ -356,7 +356,7 @@ void LLMediaCtrl::onFocusLost()
//
BOOL LLMediaCtrl::postBuild ()
{
- mVisibleSignal.connect(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLMediaCtrl::onVisibilityChange, this, _2));
return TRUE;
}
diff --git a/indra/newview/llmoveview.cpp b/indra/newview/llmoveview.cpp
index 93db337053..9e46a4422a 100644
--- a/indra/newview/llmoveview.cpp
+++ b/indra/newview/llmoveview.cpp
@@ -586,7 +586,8 @@ void LLPanelStandStopFlying::setVisible(BOOL visible)
updatePosition();
}
- LLPanel::setVisible(visible);
+ //change visibility of parent layout_panel to animate in/out
+ if (getParent()) getParent()->setVisible(visible);
}
BOOL LLPanelStandStopFlying::handleToolTip(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/llnavigationbar.cpp b/indra/newview/llnavigationbar.cpp
index 114d26af8a..c1bd4dd580 100644
--- a/indra/newview/llnavigationbar.cpp
+++ b/indra/newview/llnavigationbar.cpp
@@ -230,6 +230,16 @@ BOOL LLNavigationBar::postBuild()
return TRUE;
}
+void LLNavigationBar::setVisible(BOOL visible)
+{
+ // change visibility of grandparent layout_panel to animate in and out
+ if (getParent() && getParent()->getParent())
+ {
+ getParent()->getParent()->setVisible(visible);
+ }
+}
+
+
void LLNavigationBar::fillSearchComboBox()
{
if(!mSearchComboBox)
diff --git a/indra/newview/llnavigationbar.h b/indra/newview/llnavigationbar.h
index 52f5a827e4..6f5175d1ae 100644
--- a/indra/newview/llnavigationbar.h
+++ b/indra/newview/llnavigationbar.h
@@ -56,6 +56,7 @@ public:
/*virtual*/ void draw();
/*virtual*/ BOOL handleRightMouseDown(S32 x, S32 y, MASK mask);
/*virtual*/ BOOL postBuild();
+ /*virtual*/ void setVisible(BOOL visible);
void handleLoginComplete();
void clearHistoryCache();
diff --git a/indra/newview/llpanelavatartag.cpp b/indra/newview/llpanelavatartag.cpp
index 03ad19f911..7563cc7f61 100644
--- a/indra/newview/llpanelavatartag.cpp
+++ b/indra/newview/llpanelavatartag.cpp
@@ -92,7 +92,7 @@ void LLPanelAvatarTag::setAvatarId(const LLUUID& avatar_id)
boost::signals2::connection LLPanelAvatarTag::setLeftButtonClickCallback(
const commit_callback_t& cb)
{
- return mCommitSignal.connect(cb);
+ return setCommitCallback(cb);
}
BOOL LLPanelAvatarTag::handleMouseDown(S32 x, S32 y, MASK mask)
diff --git a/indra/newview/llpanelpeople.cpp b/indra/newview/llpanelpeople.cpp
index 4dc8872557..03421ce4f0 100644
--- a/indra/newview/llpanelpeople.cpp
+++ b/indra/newview/llpanelpeople.cpp
@@ -483,7 +483,7 @@ void LLPanelPeople::onFriendsAccordionExpandedCollapsed(const LLSD& param, LLAva
BOOL LLPanelPeople::postBuild()
{
- mVisibleSignal.connect(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLPanelPeople::onVisibilityChange, this, _2));
mFilterEditor = getChild<LLFilterEditor>("filter_input");
mFilterEditor->setCommitCallback(boost::bind(&LLPanelPeople::onFilterEdit, this, _2));
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index 49a2a3723d..3d2c529dda 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -355,7 +355,7 @@ LLPreviewGesture::~LLPreviewGesture()
BOOL LLPreviewGesture::postBuild()
{
- mVisibleSignal.connect(boost::bind(&LLPreviewGesture::onVisibilityChange, this, _2));
+ setVisibleCallback(boost::bind(&LLPreviewGesture::onVisibilityChange, this, _2));
LLLineEditor* edit;
LLComboBox* combo;
diff --git a/indra/newview/llsidetray.cpp b/indra/newview/llsidetray.cpp
index 7711f3c733..2f98435b83 100644
--- a/indra/newview/llsidetray.cpp
+++ b/indra/newview/llsidetray.cpp
@@ -34,6 +34,7 @@
#include "lltextbox.h"
+#include "llagent.h"
#include "llbottomtray.h"
#include "llsidetray.h"
#include "llviewerwindow.h"
@@ -700,7 +701,7 @@ void LLSideTray::updateSidetrayVisibility()
// set visibility of parent container based on collapsed state
if (getParent())
{
- getParent()->setVisible(!mCollapsed);
+ getParent()->setVisible(!mCollapsed && !gAgent.cameraMouselook());
}
}
diff --git a/indra/newview/llsidetray.h b/indra/newview/llsidetray.h
index 54652c1108..7321574681 100644
--- a/indra/newview/llsidetray.h
+++ b/indra/newview/llsidetray.h
@@ -120,7 +120,7 @@ public:
void setVisible(BOOL visible)
{
- LLPanel::setVisible(visible);
+ if (getParent()) getParent()->setVisible(visible);
}
LLPanel* getButtonsPanel() { return mButtonsPanel; }
@@ -141,6 +141,7 @@ public:
void processTriState ();
+ void updateSidetrayVisibility();
protected:
LLSideTrayTab* getTab (const std::string& name);
@@ -153,10 +154,6 @@ protected:
void toggleTabButton (LLSideTrayTab* tab);
- void updateSidetrayVisibility();
-
-
-
private:
// Implementation of LLDestroyClass<LLSideTray>
static void destroyClass()
@@ -166,7 +163,6 @@ private:
LLSideTray::getInstance()->setEnabled(FALSE);
}
-
private:
LLPanel* mButtonsPanel;
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index db66faef81..29d40d073c 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1573,7 +1573,8 @@ void LLViewerWindow::initWorldUI()
LLPanel* side_tray_container = getRootView()->getChild<LLPanel>("side_tray_container");
LLSideTray* sidetrayp = LLSideTray::getInstance();
sidetrayp->setShape(side_tray_container->getLocalRect());
- sidetrayp->setFollowsAll();
+ // don't follow right edge to avoid spurious resizes, since we are using a fixed width layout
+ sidetrayp->setFollows(FOLLOWS_LEFT|FOLLOWS_TOP|FOLLOWS_BOTTOM);
side_tray_container->addChild(sidetrayp);
side_tray_container->setVisible(FALSE);
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 507c726e02..5aad87630d 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -344,7 +344,12 @@ LLPipeline::LLPipeline() :
mWLSkyPool(NULL),
mLightMask(0),
mLightMovingMask(0),
- mLightingDetail(0)
+ mLightingDetail(0),
+ mScreenWidth(0),
+ mScreenHeight(0),
+ mViewportWidth(0),
+ mViewportHeight(0)
+
{
mNoiseMap = 0;
mTrueNoiseMap = 0;
@@ -518,13 +523,29 @@ void LLPipeline::resizeScreenTexture()
GLuint view_height = gViewerWindow->getWorldViewHeightRaw();
allocateScreenBuffer(resX, resY, view_width, view_height);
-
- llinfos << "RESIZED SCREEN TEXTURE: " << resX << "x" << resY << llendl;
}
}
void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 viewport_width, U32 viewport_height)
{
+ bool screen_size_changed = resX != mScreenWidth || resY != mScreenHeight;
+ bool viewport_size_changed = viewport_width != mViewportWidth || viewport_height != mViewportHeight;
+
+ if (!screen_size_changed
+ && !viewport_size_changed)
+ {
+ // nothing to do
+ return;
+ }
+
+ // remember these dimensions
+ mScreenWidth = resX;
+ mScreenHeight = resY;
+ mViewportWidth = viewport_width;
+ mViewportHeight = viewport_height;
+
+ llinfos << "RESIZED SCREEN TEXTURE: " << resX << "x" << resY << llendl;
+
U32 samples = gSavedSettings.getU32("RenderFSAASamples");
U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor");
@@ -534,7 +555,8 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 viewport_width, U3
resY /= res_mod;
}
- if (gSavedSettings.getBOOL("RenderUIBuffer"))
+ if (gSavedSettings.getBOOL("RenderUIBuffer")
+ && screen_size_changed)
{
mUIScreen.allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
}
@@ -542,25 +564,39 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 viewport_width, U3
if (LLPipeline::sRenderDeferred)
{
//allocate deferred rendering color buffers
- mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
- mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ if (screen_size_changed)
+ {
+ mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ addDeferredAttachments(mDeferredScreen);
+ }
+ // always set viewport to desired size, since allocate resets the viewport
mDeferredScreen.setViewport(viewport_width, viewport_height);
mDeferredDepth.setViewport(viewport_width, viewport_height);
- addDeferredAttachments(mDeferredScreen);
- mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
- mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+
+ if (screen_size_changed)
+ {
+ mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ }
mScreen.setViewport(viewport_width, viewport_height);
mEdgeMap.setViewport(viewport_width, viewport_height);
for (U32 i = 0; i < 3; i++)
{
- mDeferredLight[i].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+ if (screen_size_changed)
+ {
+ mDeferredLight[i].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+ }
mDeferredLight[i].setViewport(viewport_width, viewport_height);
}
for (U32 i = 0; i < 2; i++)
{
- mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+ if (screen_size_changed)
+ {
+ mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+ }
mGIMapPost[i].setViewport(viewport_width, viewport_height);
}
@@ -568,7 +604,10 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 viewport_width, U3
for (U32 i = 0; i < 4; i++)
{
- mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+ if (screen_size_changed)
+ {
+ mShadow[i].allocate(U32(resX*scale),U32(resY*scale), 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE);
+ }
mShadow[i].setViewport(viewport_width, viewport_height);
}
@@ -578,7 +617,10 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 viewport_width, U3
for (U32 i = 4; i < 6; i++)
{
- mShadow[i].allocate(width, height, 0, TRUE, FALSE);
+ if (screen_size_changed)
+ {
+ mShadow[i].allocate(width, height, 0, TRUE, FALSE);
+ }
mShadow[i].setViewport(viewport_width, viewport_height);
}
@@ -586,32 +628,41 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 viewport_width, U3
width = nhpo2(resX)/2;
height = nhpo2(resY)/2;
- mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE);
+ if (screen_size_changed)
+ {
+ mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE);
+ }
mLuminanceMap.setViewport(viewport_width, viewport_height);
}
else
{
- mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ if (screen_size_changed)
+ {
+ mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE);
+ }
mScreen.setViewport(viewport_width, viewport_height);
}
if (gGLManager.mHasFramebufferMultisample && samples > 1)
{
- mSampleBuffer.allocate(resX,resY,GL_RGBA,TRUE,TRUE,LLTexUnit::TT_RECT_TEXTURE,FALSE,samples);
- mSampleBuffer.setViewport(viewport_width, viewport_height);
- mScreen.setSampleBuffer(&mSampleBuffer);
-
- if (LLPipeline::sRenderDeferred)
+ if (screen_size_changed)
{
- addDeferredAttachments(mSampleBuffer);
- mDeferredScreen.setSampleBuffer(&mSampleBuffer);
+ mSampleBuffer.allocate(resX,resY,GL_RGBA,TRUE,TRUE,LLTexUnit::TT_RECT_TEXTURE,FALSE,samples);
+ if (LLPipeline::sRenderDeferred)
+ {
+ addDeferredAttachments(mSampleBuffer);
+ mDeferredScreen.setSampleBuffer(&mSampleBuffer);
+ }
}
+ mSampleBuffer.setViewport(viewport_width, viewport_height);
+ mScreen.setSampleBuffer(&mSampleBuffer);
stop_glerror();
}
- if (LLPipeline::sRenderDeferred)
+ if (LLPipeline::sRenderDeferred
+ && screen_size_changed)
{ //share depth buffer between deferred targets
mDeferredScreen.shareDepthBuffer(mScreen);
for (U32 i = 0; i < 3; i++)
@@ -726,6 +777,10 @@ void LLPipeline::createGLBuffers()
mGlow[i].allocate(512,glow_res,GL_RGBA,FALSE,FALSE);
}
+ // force reallocation of buffers by clearing known dimensions
+ mScreenWidth = 0;
+ mScreenHeight = 0;
+
allocateScreenBuffer(resX,resY, viewport_width, viewport_height);
}
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 9193e19bb1..11b7b55f20 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -467,6 +467,11 @@ public:
static F32 sMinRenderSize;
//screen texture
+ U32 mScreenWidth;
+ U32 mScreenHeight;
+ U32 mViewportWidth;
+ U32 mViewportHeight;
+
LLRenderTarget mScreen;
LLRenderTarget mUIScreen;
LLRenderTarget mDeferredScreen;
diff --git a/indra/newview/skins/default/xui/en/main_view.xml b/indra/newview/skins/default/xui/en/main_view.xml
index 14a4949df7..3bf7f50a2c 100644
--- a/indra/newview/skins/default/xui/en/main_view.xml
+++ b/indra/newview/skins/default/xui/en/main_view.xml
@@ -15,19 +15,19 @@
orientation="vertical"
top="0">
<layout_panel auto_resize="false"
- min_height="19"
+ height="84"
mouse_opaque="false"
- name="status_bar_container"
- height="19"
+ name="nav_and_status_bar_region"
width="1024"
- visible="false"/>
- <layout_panel auto_resize="false"
- height="65"
- mouse_opaque="false"
- name="nav_bar_container"
- width="1024"
- visible="false"/>
- <panel auto_resize="true"
+ visible="false">
+ <panel follows="left|right|bottom"
+ left="0"
+ name="nav_bar_container"
+ right="1024"
+ top="19"
+ height="65"/>
+ </layout_panel>
+ <layout_panel auto_resize="true"
follows="all"
height="500"
layout="topleft"
@@ -124,8 +124,16 @@
height="500"
name="DebugView"
width="1024"/>
- </panel>
+ </layout_panel>
</layout_stack>
+ <panel mouse_opaque="false"
+ follows="left|right|top"
+ name="status_bar_container"
+ height="19"
+ left="0"
+ top="0"
+ width="1024"
+ visible="false"/>
<notify_box_view top="0"
follows="all"
height="768"