summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--src/graphics.cpp4
-rw-r--r--src/graphics.h3
-rw-r--r--src/openglgraphics.cpp14
-rw-r--r--src/openglgraphics.h3
5 files changed, 20 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 8230cd8c..20a21e4b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,9 @@
* src/gui/button.cpp: Fixed incorrect button dimensions, as they mess
OpenGL display with rectangle textures.
+ * src/graphics.cpp, src/openglgraphics.h, src/graphics.h,
+ src/openglgraphics.cpp: Fixed fonts not being recolored by adding an
+ explicit parameter to require it.
2007-08-25 Guillaume Melquiond <guillaume.melquiond@gmail.com>
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 5ece979d..a6a34357 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -127,7 +127,7 @@ bool Graphics::drawImage(Image *image, int x, int y)
}
bool Graphics::drawImage(Image *image, int srcX, int srcY, int dstX, int dstY,
- int width, int height)
+ int width, int height, bool)
{
// Check that preconditions for blitting are met.
if (!mScreen || !image || !image->mImage) return false;
@@ -154,7 +154,7 @@ void Graphics::drawImage(gcn::Image const *image, int srcX, int srcY,
ProxyImage const *srcImage =
dynamic_cast< ProxyImage const * >(image);
assert(srcImage);
- drawImage(srcImage->getImage(), srcX, srcY, dstX, dstY, width, height);
+ drawImage(srcImage->getImage(), srcX, srcY, dstX, dstY, width, height, true);
}
void Graphics::drawImagePattern(Image *image, int x, int y, int w, int h)
diff --git a/src/graphics.h b/src/graphics.h
index e12b066e..564826a2 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -101,7 +101,8 @@ class Graphics : public gcn::SDLGraphics {
drawImage(Image *image,
int srcX, int srcY,
int dstX, int dstY,
- int width, int height);
+ int width, int height,
+ bool useColor = false);
virtual void
drawImagePattern(Image *image,
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index b1e6ef81..509107d5 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -105,12 +105,16 @@ bool OpenGLGraphics::setVideoMode(int w, int h, int bpp, bool fs, bool hwaccel)
}
bool OpenGLGraphics::drawImage(Image *image, int srcX, int srcY,
- int dstX, int dstY, int width, int height)
+ int dstX, int dstY, int width, int height, bool useColor)
{
srcX += image->mBounds.x;
srcY += image->mBounds.y;
- glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha);
+ if (!useColor)
+ {
+ glColor4f(1.0f, 1.0f, 1.0f, image->mAlpha);
+ }
+
glBindTexture(Image::mTextureType, image->mGLImage);
setTexturingAndBlending(true);
@@ -148,7 +152,11 @@ bool OpenGLGraphics::drawImage(Image *image, int srcX, int srcY,
}
glEnd();
- glColor4ub(mColor.r, mColor.g, mColor.b, mColor.a);
+
+ if (!useColor)
+ {
+ glColor4ub(mColor.r, mColor.g, mColor.b, mColor.a);
+ }
return true;
}
diff --git a/src/openglgraphics.h b/src/openglgraphics.h
index 36e6efcd..ee5bc1e1 100644
--- a/src/openglgraphics.h
+++ b/src/openglgraphics.h
@@ -38,7 +38,8 @@ class OpenGLGraphics : public Graphics
bool drawImage(Image *image,
int srcX, int srcY,
int dstX, int dstY,
- int width, int height);
+ int width, int height,
+ bool useColor);
void updateScreen();