summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2010-04-16 13:06:03 -0600
committerScott Moreau <oreaus@gmail.com>2010-04-16 13:06:03 -0600
commit810ad32adf452d10edbc5f9b0e1f49850e13ad46 (patch)
tree76e5582c9d396d775353a4459095f8cc3bfd00fa
parentb6033ed90f69fb0b03e7a52cc4a363b12bebf14b (diff)
downloadwallpaper-810ad32adf452d10edbc5f9b0e1f49850e13ad46.tar.gz
wallpaper-810ad32adf452d10edbc5f9b0e1f49850e13ad46.tar.bz2
Apply any existing transparency.
-rw-r--r--src/wallpaper.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/wallpaper.cpp b/src/wallpaper.cpp
index 2b855b4..a5c555e 100644
--- a/src/wallpaper.cpp
+++ b/src/wallpaper.cpp
@@ -427,6 +427,7 @@ WallpaperWindow::drawBackgrounds (GLFragment::Attrib &attrib,
GLTexture::Matrix matrix;
GLTexture::MatrixList tmpMatrixList;
WallpaperBackground *back = ws->getBackgroundForViewport (bg);
+ GLFragment::Attrib tmpAttrib = attrib;
tmpMatrixList.push_back (matrix);
@@ -450,16 +451,16 @@ WallpaperWindow::drawBackgrounds (GLFragment::Attrib &attrib,
if (ws->optionGetCycleWallpapers ())
{
if (fadingIn)
- attrib.setOpacity (OPAQUE * (1.0f - ws->alpha));
+ tmpAttrib.setOpacity ((OPAQUE * (1.0f - ws->alpha)) * (attrib.getOpacity () / (float)OPAQUE));
else
- attrib.setOpacity (OPAQUE * ws->alpha);
+ tmpAttrib.setOpacity ((OPAQUE * ws->alpha) * (attrib.getOpacity () / (float)OPAQUE));
}
- if (attrib.getOpacity () != OPAQUE)
+ if (tmpAttrib.getOpacity () != OPAQUE)
mask |= PAINT_WINDOW_BLEND_MASK;
if (gWindow->geometry ().vCount)
- gWindow->glDrawTexture(back->fillTex[0], attrib, mask);
+ gWindow->glDrawTexture(back->fillTex[0], tmpAttrib, mask);
if (back->imgSize.width () && back->imgSize.height ())
{
@@ -557,7 +558,7 @@ WallpaperWindow::drawBackgrounds (GLFragment::Attrib &attrib,
}
if (gWindow->geometry ().vCount)
- gWindow->glDrawTexture (back->imgTex[0], attrib, mask | PAINT_WINDOW_BLEND_MASK);
+ gWindow->glDrawTexture (back->imgTex[0], tmpAttrib, mask | PAINT_WINDOW_BLEND_MASK);
}
}