X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglmatrix.c;h=3830fa94f1bcb2a18dea3394df85ff4602143bc5;hp=9b5754069a039a12e39e14a635ce8a839ba60a7c;hb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;hpb=96a411663168b0ba5432b407a83be55f3df0c802 diff --git a/hacks/glx/glmatrix.c b/hacks/glx/glmatrix.c index 9b575406..3830fa94 100644 --- a/hacks/glx/glmatrix.c +++ b/hacks/glx/glmatrix.c @@ -209,13 +209,13 @@ static XrmOptionDescRec opts[] = { }; static argtype vars[] = { - {(caddr_t *) &mode_str, "mode", "Mode", DEF_MODE, t_String}, - {(caddr_t *) &speed, "speed", "Speed", DEF_SPEED, t_Float}, - {(caddr_t *) &density, "density", "Density", DEF_DENSITY, t_Float}, - {(caddr_t *) &do_fog, "fog", "Fog", DEF_FOG, t_Bool}, - {(caddr_t *) &do_waves, "waves", "Waves", DEF_WAVES, t_Bool}, - {(caddr_t *) &do_rotate, "rotate", "Rotate", DEF_ROTATE, t_Bool}, - {(caddr_t *) &do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool}, + {&mode_str, "mode", "Mode", DEF_MODE, t_String}, + {&speed, "speed", "Speed", DEF_SPEED, t_Float}, + {&density, "density", "Density", DEF_DENSITY, t_Float}, + {&do_fog, "fog", "Fog", DEF_FOG, t_Bool}, + {&do_waves, "waves", "Waves", DEF_WAVES, t_Bool}, + {&do_rotate, "rotate", "Rotate", DEF_ROTATE, t_Bool}, + {&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool}, }; ModeSpecOpt matrix_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -400,8 +400,8 @@ draw_glyph (ModeInfo *mi, int glyph, we fade towards a completely solid rectangle. WTF? So, for now, instead of changing the alpha, just make the colors - be darker. This isn't quite right (it causes a large dark glyph - to occlude the brighter glyphs behind it) but it's close... + be darker. This works out ok so long as we use GL_ONE in + glBlendFunc, so that stacked glyph colors are added together. */ r *= a; g *= a; @@ -863,7 +863,13 @@ init_matrix (ModeInfo *mi) load_textures (mi, flip_p); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); - glBlendFunc(GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA); + + /* Jeff Epler points out: + By using GL_ONE instead of GL_SRC_ALPHA, glyphs are added to + each other, so that a bright glyph with a darker one in front + is a little brighter than the bright glyph alone. + */ + glBlendFunc (GL_ONE_MINUS_SRC_ALPHA, /* GL_SRC_ALPHA */ GL_ONE); } /* to scale coverage-percent to strips, this number looks about right... */