summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/splash.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-11 14:19:06 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2006-10-11 14:19:06 +0000
commit99fbf46f89e9dddd0756feb10f287703e88a6c44 (patch)
tree97dba58a06077390e9564c32720efef9e284fa4a /beryl-plugins/src/splash.c
parent0acdb271497ced9ebacd70aed09320b942f21b86 (diff)
downloadmarex-dev-99fbf46f89e9dddd0756feb10f287703e88a6c44.tar.gz
marex-dev-99fbf46f89e9dddd0756feb10f287703e88a6c44.tar.bz2
fix output handling for different output resolutions
git-svn-id: file:///beryl/trunk@602 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/splash.c')
-rw-r--r--beryl-plugins/src/splash.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/beryl-plugins/src/splash.c b/beryl-plugins/src/splash.c
index 80016ec..a0ca190 100644
--- a/beryl-plugins/src/splash.c
+++ b/beryl-plugins/src/splash.c
@@ -318,7 +318,8 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
(sd->opt[SPLASH_DISPLAY_OPTION_FADE_TIME].value.f * 1000.0));
float darken =
1.0 - (sd->opt[SPLASH_DISPLAY_OPTION_BRIGHTNESS].value.f / 100.0);
- float sat = sd->opt[SPLASH_DISPLAY_OPTION_SATURATION].value.f / 100.0;
+ float sat = 1.0 - (sd->opt[SPLASH_DISPLAY_OPTION_SATURATION].value.f / 100.0);
+ if (sat == 1.0) sat = 0.9999;
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
@@ -327,8 +328,7 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
{
glEnable (GL_TEXTURE_RECTANGLE_ARB);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, ss->background.handle);
- glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, s_x, s_y, s_x, s_y,
- s_width, s_height);
+ glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, s_x, s->height - s_height - s_y, s_x, s->height - s_height - s_y, s_width, s_height);
GLfloat constant[4];
@@ -376,13 +376,13 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
glTexEnvfv (GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, constant);
glBegin (GL_QUADS);
- glTexCoord2f (s_x, s_y + s_height);
+ glTexCoord2f (s_x, s->height - s_y);
glVertex2f (s_x, s_y);
- glTexCoord2f (s_x, s_y);
+ glTexCoord2f (s_x, s->height - s_height - s_y);
glVertex2f (s_x, s_y + s_height);
- glTexCoord2f (s_x + s_width, s_y);
+ glTexCoord2f (s_x + s_width, s->height - s_height - s_y);
glVertex2f (s_x + s_width, s_y + s_height);
- glTexCoord2f (s_x + s_width, s_y + s_height);
+ glTexCoord2f (s_x + s_width, s->height - s_y);
glVertex2f (s_x + s_width, s_y);
glEnd ();
@@ -416,8 +416,7 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
ss->doUpdate = FALSE;
glEnable (GL_TEXTURE_RECTANGLE_ARB);
glBindTexture (GL_TEXTURE_RECTANGLE_ARB, ss->background.handle);
- glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, s_x, s_y, s_x,
- s_y, s_width, s_height);
+ glCopyTexSubImage2D (GL_TEXTURE_RECTANGLE_ARB, 0, s_x, s->height - s_height - s_y, s_x, s->height - s_height - s_y, s_width, s_height);
glDisable (GL_TEXTURE_RECTANGLE_ARB);
glPopMatrix ();
glDisable (GL_BLEND);
@@ -439,14 +438,13 @@ splashPaintScreen (CompScreen * s, const ScreenPaintAttrib * sa,
glColor4f (1.0, 1.0, 1.0, alpha);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
glBegin (GL_QUADS);
- glBegin (GL_QUADS);
- glTexCoord2f (s_x, s_y + s_height);
+ glTexCoord2f (s_x, s->height - s_y);
glVertex2f (s_x, s_y);
- glTexCoord2f (s_x, s_y);
+ glTexCoord2f (s_x, s->height - s_height - s_y);
glVertex2f (s_x, s_y + s_height);
- glTexCoord2f (s_x + s_width, s_y);
+ glTexCoord2f (s_x + s_width, s->height - s_height - s_y);
glVertex2f (s_x + s_width, s_y + s_height);
- glTexCoord2f (s_x + s_width, s_y + s_height);
+ glTexCoord2f (s_x + s_width, s->height - s_y);
glVertex2f (s_x + s_width, s_y);
glEnd ();