summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-17 11:58:11 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-09-17 11:58:11 +0000
commit86db7587fed4adb99b9092a5d13da127d43c65a9 (patch)
treec23e97ed54f17828c1fcf98f07d8f6795d5dccda
parentd9b11c20d5d0313e9257f054a6e3a63989c7bc71 (diff)
downloadMana-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.
-rw-r--r--ChangeLog6
-rw-r--r--src/openglgraphics.cpp9
2 files changed, 8 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index bba0ff46..792a3ca5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2005-09-17 Björn Steinbrink <B.Steinbrink@gmx.de>
+
+ * src/openglgraphics.cpp: Use gl{Push,Pop}Matrix instead of
+ calculating offsets, cause the values are stored as float and aren't
+ accurate enough.
+
2005-09-17 Eugenio Favalli <elvenprogrammer@gmail.com>
* The Mana World.dev, src/gui/skill.cpp: Updated to last changes, and
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,