From 13abfc42956e176c9779ee41fddc95a4b85cb389 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 20 Oct 2013 15:19:01 +0300 Subject: Remove glPushMatrix and glPopMatrix from OpenGL renderers except safe opengl. --- src/render/mobileopenglgraphics.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/render/mobileopenglgraphics.cpp') 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(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(transX), + static_cast(transY), 0); + } glScissor(clipArea.x, mRect.h - clipArea.y - clipArea.height, clipArea.width, clipArea.height); } -- cgit v1.2.3-60-g2f50