From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / vermiculate.c
index 26011446cf4e9709842d6fcbea294abedc710f02..c50785afda811afd6510ef267b9a2977ded15a6a 100644 (file)
@@ -209,9 +209,8 @@ static void
 randpal (struct state *st)
 {
   int ncolors = tailmax - 1;
-  make_random_colormap (st->dpy,
-                       st->xgwa.visual,
-                       st->mycmap, &st->mycolors[1], &ncolors, True, True, 0, True);
+  make_random_colormap (st->xgwa.screen, st->xgwa.visual, st->mycmap,
+                        &st->mycolors[1], &ncolors, True, True, 0, True);
   if (ncolors < tailmax - 1)
     {
       int c;
@@ -264,7 +263,7 @@ bordupdate (struct state *st)
     for (x = xmin; x <= xmax; x++)
       sp (st, x, ybord, st->bordcol);
     for (y = ymin; y <= ymax; y++)
-      sp (st, ybord, y, st->bordcol);
+      sp (st, xbord, y, st->bordcol);
   }
 }
 
@@ -795,7 +794,7 @@ vermiculate_init (Display *d, Window w)
     st->mygc = XCreateGC (st->dpy, st->window, 0, &mygcv);
   }
 
-  st->point = (unsigned char *) malloc (st->wid * st->hei);
+  st->point = (unsigned char *) calloc (1, st->wid * st->hei);
   maininit (st);
   palupdate (st, True);
   consume_instring(st);
@@ -807,6 +806,11 @@ static void
 vermiculate_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  st->wid = w;
+  st->hei = h;
+  free (st->point);
+  st->point = (unsigned char *) calloc (1, st->wid * st->hei);
 }
 
 static Bool
@@ -1198,8 +1202,12 @@ vermiculate_free (Display *dpy, Window window, void *closure)
 static const char *vermiculate_defaults[] = {
   ".background: Black",
   "*ticks: 20000",
+  "*fpsSolid:  true",
   "*speed: 0",
   "*instring: ",
+#ifdef USE_IPHONE
+  "*ignoreRotation: True",
+#endif
   0
 };