X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fboxfit.c;h=5daa72cb982f64eca9745a1a079a49140117eb93;hp=1fa42ca0e75d454d55e23bde6faf0965ec511683;hb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;hpb=ec8d2b32b63649e6d32bdfb306eda062769af823 diff --git a/hacks/boxfit.c b/hacks/boxfit.c index 1fa42ca0..5daa72cb 100644 --- a/hacks/boxfit.c +++ b/hacks/boxfit.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 2005-2008 Jamie Zawinski +/* xscreensaver, Copyright (c) 2005-2012 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 @@ -39,6 +39,7 @@ typedef struct { int spacing; int inc; + int mode; Bool circles_p; Bool growing_p; Bool color_horiz_p; @@ -64,8 +65,6 @@ typedef struct { static void reset_boxes (state *st) { - int mode = -1; - st->nboxes = 0; st->growing_p = True; st->color_horiz_p = random() & 1; @@ -77,11 +76,11 @@ reset_boxes (state *st) { char *s = get_string_resource (st->dpy, "mode", "Mode"); if (!s || !*s || !strcasecmp (s, "random")) - mode = -1; + st->mode = -1; else if (!strcasecmp (s, "squares") || !strcasecmp (s, "square")) - mode = 0; + st->mode = 0; else if (!strcasecmp (s, "circles") || !strcasecmp (s, "circle")) - mode = 1; + st->mode = 1; else { fprintf (stderr, @@ -91,10 +90,10 @@ reset_boxes (state *st) } } - if (mode == -1) + if (st->mode == -1) st->circles_p = random() & 1; else - st->circles_p = (mode == 1); + st->circles_p = (st->mode == 1); st->done_once = True;