summaryrefslogtreecommitdiff
path: root/src/openglgraphics.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-09-23 00:08:38 +0200
committerBertram <bertram@cegetel.net>2009-09-23 00:08:38 +0200
commit5aad04d3333f9a75b8eeea28802422d7c310304d (patch)
tree4346fe7379c8330afeb667dcce69ca5ad04ba70e /src/openglgraphics.cpp
parenta4862f48de85b0eee8eb23b0afe3da45f8cedcbc (diff)
downloadmana-client-5aad04d3333f9a75b8eeea28802422d7c310304d.tar.gz
mana-client-5aad04d3333f9a75b8eeea28802422d7c310304d.tar.bz2
mana-client-5aad04d3333f9a75b8eeea28802422d7c310304d.tar.xz
mana-client-5aad04d3333f9a75b8eeea28802422d7c310304d.zip
Added a basic smooth effect to rescaled wallpapers in OpenGL.
The current login wallpaper (as any streched ones) will look a bit less ugly...
Diffstat (limited to 'src/openglgraphics.cpp')
-rw-r--r--src/openglgraphics.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/openglgraphics.cpp b/src/openglgraphics.cpp
index 4d66a919..50b46f11 100644
--- a/src/openglgraphics.cpp
+++ b/src/openglgraphics.cpp
@@ -210,6 +210,19 @@ bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY,
int desiredWidth, int desiredHeight,
bool useColor)
{
+ return drawRescaledImage(image, srcX, srcY,
+ dstX, dstY,
+ width, height,
+ desiredWidth, desiredHeight,
+ useColor, true);
+}
+
+bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY,
+ int dstX, int dstY,
+ int width, int height,
+ int desiredWidth, int desiredHeight,
+ bool useColor, bool smooth)
+{
if (!image)
return false;
@@ -227,6 +240,16 @@ bool OpenGLGraphics::drawRescaledImage(Image *image, int srcX, int srcY,
glBegin(GL_QUADS);
drawRescaledQuad(image, srcX, srcY, dstX, dstY, width, height,
desiredWidth, desiredHeight);
+
+ if (smooth) // A basic smooth effect...
+ {
+ glColor4f(1.0f, 1.0f, 1.0f, 0.2f);
+ drawRescaledQuad(image, srcX, srcY, dstX - 1, dstY - 1, width, height,
+ desiredWidth + 1, desiredHeight + 1);
+ drawRescaledQuad(image, srcX, srcY, dstX + 1, dstY + 1, width, height,
+ desiredWidth - 1, desiredHeight - 1);
+ }
+
glEnd();
if (!useColor)