From http://www.jwz.org/xscreensaver/xscreensaver-5.22.tar.gz
[xscreensaver] / hacks / critical.c
index 5669304b374df58b38c1bb18d146c3f88d4b5f45..ab3a6f7366e3ca853b6b2031f950dd212e105ef0 100644 (file)
@@ -216,21 +216,21 @@ setup_colormap (struct state *st, XColor **colors, int *n_colors)
   
   if (!strcmp (color_scheme, "random"))
     {
-      make_random_colormap (st->dpy, st->wattr.visual,
+      make_random_colormap (st->wattr.screen, st->wattr.visual,
                            st->wattr.colormap,
                            *colors, n_colors,
                            True, True, &writable, True);
     }
   else if (!strcmp (color_scheme, "smooth"))
     {
-      make_smooth_colormap (st->dpy, st->wattr.visual,
+      make_smooth_colormap (st->wattr.screen, st->wattr.visual,
                            st->wattr.colormap,
                            *colors, n_colors,
                            True, &writable, True);
     }
   else 
     {
-      make_uniform_colormap (st->dpy, st->wattr.visual,
+      make_uniform_colormap (st->wattr.screen, st->wattr.visual,
                             st->wattr.colormap,
                             *colors, n_colors, True,
                             &writable, True);
@@ -242,7 +242,7 @@ setup_colormap (struct state *st, XColor **colors, int *n_colors)
 static void
 free_colormap (struct state *st, XColor **colors, int n_colors)
 {
-  free_colors (st->dpy, st->wattr.colormap, *colors, n_colors);
+  free_colors (st->wattr.screen, st->wattr.colormap, *colors, n_colors);
   free (*colors);
 }
 
@@ -289,7 +289,8 @@ critical_init (Display *dpy, Window window)
      screens. */
   model_w = 80;
   st->settings.cell_size = st->wattr.width / model_w;
-  model_h = st->wattr.height / st->settings.cell_size;
+  model_h = st->settings.cell_size ?
+    st->wattr.height / st->settings.cell_size : 0;
 
   /* Construct the initial model state. */
 
@@ -437,6 +438,7 @@ static XrmOptionDescRec critical_options[] = {
 /* Default xrm resources. */
 static const char *critical_defaults[] = {
   ".background:                        black",
+  "*fpsSolid:                  true",
   "*colorscheme:               smooth",
   "*delay:                     10000", 
   "*ncolors:                   64",