summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-09-14 04:05:36 +0300
committerAndrei Karas <akaras@inbox.ru>2011-09-14 04:05:36 +0300
commit2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f (patch)
treef5b11e7d80d78b286ea2f9faa6f821f24df61878
parent06dccbaa3d581aa3790ecc1d7b9c2385e16c9c20 (diff)
downloadmv-2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f.tar.gz
mv-2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f.tar.bz2
mv-2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f.tar.xz
mv-2c73f0e2300c00ec2e1c26ecb7a6c7a500381f0f.zip
Bit improve push cliparea functions in opengl backends.
-rw-r--r--src/opengl1graphics.cpp23
-rw-r--r--src/openglgraphics.cpp23
2 files changed, 22 insertions, 24 deletions
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<GLfloat>(transX),
static_cast<GLfloat>(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)
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 03d38e7e2..b67d4b2be 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -1064,22 +1064,22 @@ bool OpenGLGraphics::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<GLfloat>(transX),
static_cast<GLfloat>(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;
}
@@ -1092,10 +1092,9 @@ void OpenGLGraphics::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 OpenGLGraphics::setColor(const gcn::Color& color)