summaryrefslogtreecommitdiff
path: root/src/openglgraphics.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-20 17:16:40 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-20 17:16:40 +0000
commit84acf3eff0c6e8bdea12cadeb3c017d25bcf7ed7 (patch)
treeaecd1d143989c1c82f1da70b6036aa9098baa4c5 /src/openglgraphics.cpp
parent31df4529dfba4b5976ca11adcfcdf9a6e377ecf4 (diff)
downloadmana-84acf3eff0c6e8bdea12cadeb3c017d25bcf7ed7.tar.gz
mana-84acf3eff0c6e8bdea12cadeb3c017d25bcf7ed7.tar.bz2
mana-84acf3eff0c6e8bdea12cadeb3c017d25bcf7ed7.tar.xz
mana-84acf3eff0c6e8bdea12cadeb3c017d25bcf7ed7.zip
Added some missing state changes and checks.
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r--src/openglgraphics.cpp36
1 files changed, 28 insertions, 8 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 5008a22f..44611045 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -303,10 +303,15 @@ void OpenGLGraphics::drawPoint(int x, int y)
if (mAlpha && !mColorAlpha) {
glDisable(GL_BLEND);
mAlpha = false;
+ } else if (!mAlpha && mColorAlpha) {
+ glEnable(GL_BLEND);
+ mAlpha = true;
}
- glDisable(GL_TEXTURE_2D);
- mTexture = false;
+ if (mTexture) {
+ glDisable(GL_TEXTURE_2D);
+ mTexture = false;
+ }
glBegin(GL_POINTS);
glVertex3i(x, y, 0);
@@ -323,10 +328,15 @@ void OpenGLGraphics::drawLine(int x1, int y1, int x2, int y2)
if (mAlpha && !mColorAlpha) {
glDisable(GL_BLEND);
mAlpha = false;
+ } else if (!mAlpha && mColorAlpha) {
+ glEnable(GL_BLEND);
+ mAlpha = true;
}
- glDisable(GL_TEXTURE_2D);
- mTexture = false;
+ if (mTexture) {
+ glDisable(GL_TEXTURE_2D);
+ mTexture = false;
+ }
glBegin(GL_LINES);
glVertex3f(x1+0.5f, y1+0.5f, 0);
@@ -343,10 +353,15 @@ void OpenGLGraphics::drawRectangle(const gcn::Rectangle& rectangle)
if (mAlpha && !mColorAlpha) {
glDisable(GL_BLEND);
mAlpha = false;
+ } else if (!mAlpha && mColorAlpha) {
+ glEnable(GL_BLEND);
+ mAlpha = true;
}
- glDisable(GL_TEXTURE_2D);
- mTexture = false;
+ if (mTexture) {
+ glDisable(GL_TEXTURE_2D);
+ mTexture = false;
+ }
glBegin(GL_LINE_LOOP);
glVertex3f(rectangle.x + mClipStack.top().xOffset + 0.5f,
@@ -365,10 +380,15 @@ void OpenGLGraphics::fillRectangle(const gcn::Rectangle& rectangle)
if (mAlpha && !mColorAlpha) {
glDisable(GL_BLEND);
mAlpha = false;
+ } else if (!mAlpha && mColorAlpha) {
+ glEnable(GL_BLEND);
+ mAlpha = true;
}
- glDisable(GL_TEXTURE_2D);
- mTexture = false;
+ if (mTexture) {
+ glDisable(GL_TEXTURE_2D);
+ mTexture = false;
+ }
glBegin(GL_QUADS);
glVertex3i(rectangle.x + mClipStack.top().xOffset,