From http://www.jwz.org/xscreensaver/xscreensaver-5.18.tar.gz
[xscreensaver] / hacks / starfish.c
index 4390b2da118550d5bdbf9aac68393ee559d9e20a..071dccb6f83819f4f60d37f6d911b5691cd74eed 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1997, 1998, 2006 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1997-2008 Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -436,7 +436,7 @@ starfish_init (Display *dpy, Window window)
   st->delay2 = get_integer_resource (st->dpy, "delay2", "Delay") * 1000000;
 /*  st->duration = get_seconds_resource (st->dpy, "duration", "Seconds");*/
   st->duration = get_integer_resource (st->dpy, "duration", "Seconds");
-  st->direction = (random() % 1) ? 1 : -1;
+  st->direction = (random() & 1) ? 1 : -1;
 
   s = get_string_resource (st->dpy, "mode", "Mode");
   if (s && !strcasecmp (s, "blob"))
@@ -493,6 +493,10 @@ static void
 starfish_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  free_starfish (st->starfish);
+  st->starfish = 0;
+  st->starfish = reset_starfish (st);
 }
 
 static Bool
@@ -514,6 +518,7 @@ starfish_free (Display *dpy, Window window, void *closure)
 static const char *starfish_defaults [] = {
   ".background:                black",
   ".foreground:                white",
+  "*fpsSolid:          true",
   "*delay:             10000",
   "*thickness:         0",             /* pixels, 0 = random */
   "*rotation:          -1",            /* degrees, -1 = "random" */