summaryrefslogtreecommitdiff
path: root/src/render/mobileopenglgraphics.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-10-20 15:19:01 +0300
committerAndrei Karas <akaras@inbox.ru>2013-10-20 15:19:46 +0300
commit13abfc42956e176c9779ee41fddc95a4b85cb389 (patch)
tree6c8b11fdadf23cc2c6029515cecb5b096dd9160b /src/render/mobileopenglgraphics.cpp
parenteff128d7019ea0cd137a5fff6cc67825f90c4e1b (diff)
downloadmanaverse-13abfc42956e176c9779ee41fddc95a4b85cb389.tar.gz
manaverse-13abfc42956e176c9779ee41fddc95a4b85cb389.tar.bz2
manaverse-13abfc42956e176c9779ee41fddc95a4b85cb389.tar.xz
manaverse-13abfc42956e176c9779ee41fddc95a4b85cb389.zip
Remove glPushMatrix and glPopMatrix from OpenGL renderers except safe opengl.
Diffstat (limited to 'src/render/mobileopenglgraphics.cpp')
-rw-r--r--src/render/mobileopenglgraphics.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp
index 3fec19f15..91184958b 100644
--- a/src/render/mobileopenglgraphics.cpp
+++ b/src/render/mobileopenglgraphics.cpp
@@ -960,7 +960,6 @@ bool MobileOpenGLGraphics::pushClipArea(gcn::Rectangle area)
transX += clipArea.xOffset;
transY += clipArea.yOffset;
- glPushMatrix();
if (transX || transY)
{
glTranslatef(static_cast<GLfloat>(transX),
@@ -974,13 +973,26 @@ bool MobileOpenGLGraphics::pushClipArea(gcn::Rectangle area)
void MobileOpenGLGraphics::popClipArea()
{
+ if (mClipStack.empty())
+ return;
+
+ const gcn::ClipRectangle &clipArea1 = mClipStack.top();
+ int transX = -clipArea1.xOffset;
+ int transY = -clipArea1.yOffset;
+
gcn::Graphics::popClipArea();
if (mClipStack.empty())
return;
- glPopMatrix();
const gcn::ClipRectangle &clipArea = mClipStack.top();
+ transX += clipArea.xOffset;
+ transY += clipArea.yOffset;
+ if (transX || transY)
+ {
+ glTranslatef(static_cast<GLfloat>(transX),
+ static_cast<GLfloat>(transY), 0);
+ }
glScissor(clipArea.x, mRect.h - clipArea.y - clipArea.height,
clipArea.width, clipArea.height);
}