From 2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 14 Sep 2011 04:05:36 +0300 Subject: Bit improve push cliparea functions in opengl backends. --- src/opengl1graphics.cpp | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) (limited to 'src/opengl1graphics.cpp') diff --git a/src/opengl1graphics.cpp b/src/opengl1graphics.cpp index e93066b96..46e482df6 100644 --- a/src/opengl1graphics.cpp +++ b/src/opengl1graphics.cpp @@ -517,22 +517,22 @@ bool OpenGL1Graphics::pushClipArea(gcn::Rectangle area) if (!mClipStack.empty()) { - transX = -mClipStack.top().xOffset; - transY = -mClipStack.top().yOffset; + const gcn::ClipRectangle &clipArea = mClipStack.top(); + transX = -clipArea.xOffset; + transY = -clipArea.yOffset; } bool result = gcn::Graphics::pushClipArea(area); - transX += mClipStack.top().xOffset; - transY += mClipStack.top().yOffset; + const gcn::ClipRectangle &clipArea = mClipStack.top(); + transX += clipArea.xOffset; + transY += clipArea.yOffset; glPushMatrix(); glTranslatef(static_cast(transX), static_cast(transY), 0); - glScissor(mClipStack.top().x, - mTarget->h - mClipStack.top().y - mClipStack.top().height, - mClipStack.top().width, - mClipStack.top().height); + glScissor(clipArea.x, mTarget->h - clipArea.y - clipArea.height, + clipArea.width, clipArea.height); return result; } @@ -545,10 +545,9 @@ void OpenGL1Graphics::popClipArea() return; glPopMatrix(); - glScissor(mClipStack.top().x, - mTarget->h - mClipStack.top().y - mClipStack.top().height, - mClipStack.top().width, - mClipStack.top().height); + const gcn::ClipRectangle &clipArea = mClipStack.top(); + glScissor(clipArea.x, mTarget->h - clipArea.y - clipArea.height, + clipArea.width, clipArea.height); } void OpenGL1Graphics::setColor(const gcn::Color& color) -- cgit v1.2.3-70-g09d2