X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fwormhole.c;h=0e55eabd1b81e4e2e421cb0f2ed5cd23f5cd5f49;hp=631b42b86ad3f336c02e10f4639e950d4cff1ee1;hb=50be9bb40dc60130c99ffa568e6677779904ff70;hpb=5f1f12f2a37da634000f96d18d59cc73a8814ef7 diff --git a/hacks/wormhole.c b/hacks/wormhole.c index 631b42b8..0e55eabd 100644 --- a/hacks/wormhole.c +++ b/hacks/wormhole.c @@ -101,16 +101,16 @@ static int gang( int x1, int y1, int x2, int y2 ) tang = 90; else tang = 270; - } - if ( y1 == y2 ) { + } else if ( y1 == y2 ) { if ( x1 < x2 ) tang = 0; else tang = 180; - } else - tang = (int)(0.5+atan2( -(y2-y1), x2 - x1 ) * 180.0 / M_PI ); + } else { + tang = (int)(0.5+atan2( -(y2-y1), x2 - x1 ) * 180.0 / M_PI ); + } while ( tang < 0 ) tang += 360; @@ -170,7 +170,6 @@ static void initColorChanger( struct state *st, color_changer * ch ) { int q; - int min, max; XColor old_color, new_color; ch->shade_max = 2048; @@ -185,9 +184,6 @@ static void initColorChanger( struct state *st, color_changer * ch ) initXColor( &new_color ); for ( q = 0; q < ch->shade_max; q += ch->shade_use ){ - min = q; - max = q + ch->shade_use; - if ( max >= ch->shade_max ) max = ch->shade_max-1; blend_palette( ch->shade + q, ch->shade_use, &old_color, &new_color ); old_color = new_color;