From http://www.jwz.org/xscreensaver/xscreensaver-5.30.tar.gz
[xscreensaver] / hacks / rd-bomb.c
index 0c074ea49f442e928539ab323da3f939e9af6383..878f5b9b6996ffdad0a49e2333f31a5599634387 100644 (file)
@@ -1,4 +1,4 @@
-/* xscreensaver, Copyright (c) 1992-2008 Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-2014 Jamie Zawinski <jwz@jwz.org>
  *
  *  reaction/diffusion textures
  *  Copyright (c) 1997 Scott Draves spot@transmeta.com
@@ -95,10 +95,13 @@ pixack_init(struct state *st, int *size_h, int *size_v)
   st->height = get_integer_resource (st->dpy, "height", "Integer");
 
   if (st->width <= 0 && st->height <= 0 && (R & 1))
-    st->width = st->height = 48 + BELLRAND(256);
+    st->width = st->height = 64 + BELLRAND(512);
 
-  if (st->width  <= 0) st->width  = 48 + BELLRAND(256);
-  if (st->height <= 0) st->height = 48 + BELLRAND(256);
+  if (st->width  <= 0) st->width  = 64 + BELLRAND(512);
+  if (st->height <= 0) st->height = 64 + BELLRAND(512);
+
+  if (st->width  > st->xgwa.width)  st->width  = st->xgwa.width;
+  if (st->height > st->xgwa.height) st->height = st->xgwa.height;
 
   /* jwz: when (and only when) XSHM is in use on an SGI 8-bit visual,
      we get shear unless st->width is a multiple of 4.  I don't understand
@@ -308,6 +311,9 @@ static const char *rd_defaults [] = {
   "*useSHM:    True",
 #else
   "*useSHM:    False",
+#endif
+#ifdef USE_IPHONE
+  "*ignoreRotation: True",
 #endif
   0
 };
@@ -333,7 +339,8 @@ static void
 random_colors(struct state *st)
 {
   memset(st->colors, 0, st->ncolors*sizeof(*st->colors));
-  make_smooth_colormap (st->dpy, st->visual, st->cmap, st->colors, &st->ncolors,
+  make_smooth_colormap (st->xgwa.screen, st->visual, st->cmap,
+                        st->colors, &st->ncolors,
                        True, 0, True);
   if (st->ncolors <= 2) {
     mono_p = True;