diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-17 11:58:11 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-09-17 11:58:11 +0000 |
commit | 86db7587fed4adb99b9092a5d13da127d43c65a9 (patch) | |
tree | c23e97ed54f17828c1fcf98f07d8f6795d5dccda /src/openglgraphics.cpp | |
parent | d9b11c20d5d0313e9257f054a6e3a63989c7bc71 (diff) | |
download | mana-86db7587fed4adb99b9092a5d13da127d43c65a9.tar.gz mana-86db7587fed4adb99b9092a5d13da127d43c65a9.tar.bz2 mana-86db7587fed4adb99b9092a5d13da127d43c65a9.tar.xz mana-86db7587fed4adb99b9092a5d13da127d43c65a9.zip |
Use gl{Push,Pop}Matrix instead of calculating offsets, cause floating point maths isn't accurate enough.
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r-- | src/openglgraphics.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp index 00449d3f..86bb734a 100644 --- a/src/openglgraphics.cpp +++ b/src/openglgraphics.cpp @@ -149,6 +149,7 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area) transX += mClipStack.top().xOffset; transY += mClipStack.top().yOffset; + glPushMatrix(); glTranslatef(transX, transY, 0); glScissor(mClipStack.top().x, mScreen->h - mClipStack.top().y - mClipStack.top().height, @@ -160,9 +161,6 @@ bool OpenGLGraphics::pushClipArea(gcn::Rectangle area) void OpenGLGraphics::popClipArea() { - int transX = -mClipStack.top().xOffset; - int transY = -mClipStack.top().yOffset; - gcn::Graphics::popClipArea(); if (mClipStack.empty()) @@ -170,10 +168,7 @@ void OpenGLGraphics::popClipArea() return; } - transX += mClipStack.top().xOffset; - transY += mClipStack.top().yOffset; - - glTranslatef(transX, transY, 0); + glPopMatrix(); glScissor(mClipStack.top().x, mScreen->h - mClipStack.top().y - mClipStack.top().height, mClipStack.top().width, |