diff options
| author | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
|---|---|---|
| committer | Monroe Williams <monroe@lindenlab.com> | 2007-08-02 01:18:34 +0000 |
| commit | 7138fb673ac3df46b9cb5f23d0d74e70fdd2b6b3 (patch) | |
| tree | 3c34a3a180b5275bd4166b0056765c5868f56447 /indra/llui/llui.cpp | |
| parent | f6a10b3214d79df4e8f5768acaa68edbd2de5620 (diff) | |
Merge down from Branch_1-18-1:
svn merge --ignore-ancestry svn+ssh://svn.lindenlab.com/svn/linden/release@66449 svn+ssh://svn.lindenlab.com/svn/linden/branches/Branch_1-18-1@67131
Diffstat (limited to 'indra/llui/llui.cpp')
| -rw-r--r-- | indra/llui/llui.cpp | 60 |
1 files changed, 59 insertions, 1 deletions
diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index c65500b56c..696be050ce 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -57,6 +57,8 @@ LLVector2 LLUI::sGLScaleFactor(1.f, 1.f); LLWindow* LLUI::sWindow = NULL; LLHtmlHelp* LLUI::sHtmlHelp = NULL; BOOL LLUI::sShowXUINames = FALSE; +std::stack<LLRect> LLUI::sClipRectStack; + // // Functions // @@ -90,7 +92,7 @@ void make_ui_sound(const LLString& name) { llinfos << "ui sound name: " << name << llendl; } - LLUI::sAudioCallback(uuid, LLUI::sConfigGroup->getF32("AudioLevelUI")); + LLUI::sAudioCallback(uuid); } } } @@ -1791,3 +1793,59 @@ void LLUI::setHtmlHelp(LLHtmlHelp* html_help) { LLUI::sHtmlHelp = html_help; } + +//static +void LLUI::pushClipRect(const LLRect& rect) +{ + LLRect combined_clip_rect = rect; + if (!sClipRectStack.empty()) + { + combined_clip_rect.intersectWith(sClipRectStack.top()); + } + sClipRectStack.push(combined_clip_rect); + setScissorRegionScreen(combined_clip_rect); +} + +//static +void LLUI::popClipRect() +{ + sClipRectStack.pop(); + if (!sClipRectStack.empty()) + { + setScissorRegionScreen(sClipRectStack.top()); + } +} + +LLClipRect::LLClipRect(const LLRect& rect, BOOL enabled) : mScissorState(GL_SCISSOR_TEST, enabled), mEnabled(enabled) +{ + if (mEnabled) + { + LLUI::pushClipRect(rect); + } +} + +LLClipRect::~LLClipRect() +{ + if (mEnabled) + { + LLUI::popClipRect(); + } +} + +LLLocalClipRect::LLLocalClipRect(const LLRect &rect, BOOL enabled) : mScissorState(GL_SCISSOR_TEST, enabled), mEnabled(enabled) +{ + if (mEnabled) + { + LLRect scissor_rect = rect; + scissor_rect.translate(LLFontGL::sCurOrigin.mX, LLFontGL::sCurOrigin.mY); + LLUI::pushClipRect(scissor_rect); + } +} + +LLLocalClipRect::~LLLocalClipRect() +{ + if (mEnabled) + { + LLUI::popClipRect(); + } +} |
