diff options
author | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-20 17:16:40 +0000 |
---|---|---|
committer | Björn Steinbrink <B.Steinbrink@gmx.de> | 2005-08-20 17:16:40 +0000 |
commit | 84acf3eff0c6e8bdea12cadeb3c017d25bcf7ed7 (patch) | |
tree | aecd1d143989c1c82f1da70b6036aa9098baa4c5 /src/openglgraphics.cpp | |
parent | 31df4529dfba4b5976ca11adcfcdf9a6e377ecf4 (diff) | |
download | mana-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.cpp | 36 |
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, |