X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fgears.c;h=42a9e70b02fe5ae2a4a6ca04e34ba138cd8f7741;hb=50be9bb40dc60130c99ffa568e6677779904ff70;hp=added7c65b840fb4fc806e38873ef7307c68dff9;hpb=488f2fa8fbdbc77e91a70da2962d73af49e6cace;p=xscreensaver diff --git a/hacks/glx/gears.c b/hacks/glx/gears.c index added7c6..42a9e70b 100644 --- a/hacks/glx/gears.c +++ b/hacks/glx/gears.c @@ -1,4 +1,4 @@ -/* gears, Copyright (c) 2007 Jamie Zawinski +/* gears, Copyright (c) 2007-2008 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -124,7 +124,9 @@ gears_handle_event (ModeInfo *mi, XEvent *event) } else if (event->xany.type == ButtonPress && (event->xbutton.button == Button4 || - event->xbutton.button == Button5)) + event->xbutton.button == Button5 || + event->xbutton.button == Button6 || + event->xbutton.button == Button7)) { gltrackball_mousewheel (bp->trackball, event->xbutton.button, 10, !!event->xbutton.state); @@ -690,16 +692,20 @@ planetary_gears (ModeInfo *mi) g4->y = 0; g4->th = -g3->th; + /* rotate central gear 1/2 tooth-size if odd number of teeth */ + if (g4->nteeth & 1) + g4->th -= (180.0 / g4->nteeth); + g0->inverted_p = True; g0->x = 0; g0->y = 0; - g0->nteeth = g4->nteeth * 3; - g0->r = g4->r * 3.05; + g0->nteeth = g1->nteeth * 3; + g0->r = g1->r * 3.05; g0->inner_r = g0->r * 0.8; g0->inner_r2 = 0; g0->inner_r3 = 0; - g0->th = -(g4->th - (180 / g0->nteeth)); - g0->ratio = g4->ratio / 3; + g0->th = g1->th + (180 / g0->nteeth); + g0->ratio = g1->ratio / 3; g0->tooth_slope = 0; g0->nubs = 3; @@ -733,8 +739,6 @@ init_gears (ModeInfo *mi) fprintf(stderr, "%s: out of memory\n", progname); exit(1); } - - bp = &bps[MI_SCREEN(mi)]; } bp = &bps[MI_SCREEN(mi)];