From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / abstractile.c
index 4e80d7b7b5774a24213aaa9533cf9f7e3ca9f99a..b4394f14ec257f1c965a72466ad4bec1eccb4128 100644 (file)
@@ -90,7 +90,8 @@ struct state {
     /* draw, erase, fill, init, line, object, z indexes */
   unsigned int di, ei, fi, ii, bi, li, eli, oi, zi;
   /* size variables */
-  unsigned int gridx, gridy, gridn;                     /* grid size */
+  int gridx, gridy;                     /* grid size */
+  unsigned int gridn;
   int lwid, bwid, swid;/* line width, background width, shadow width */
   int narray, max_wxh;
   int elwid, elpu, egridx, egridy; /* for now */
@@ -205,6 +206,7 @@ _init_zlist(struct state *st)
 
   st->gridx=st->xgwa.width/st->lwid;
   st->gridy=st->xgwa.height/st->lwid;
+  if ((st->gridx <= 0) || (st->gridy <= 0)) abort();
   st->gridn=st->gridx*st->gridy;
   /* clear grid */
   for (z=0; z<st->gridn; z++) {
@@ -914,6 +916,7 @@ _getcolor(struct state *st, int x, int y)
 {
   int n, cv[LAYERS];
 
+  cv[0] = 0;
   for (n=0; n<st->layers; n++) {
     cv[n]=_pattern(st,x,y,n);
                   /* first wave/shape */
@@ -1586,7 +1589,7 @@ static const char *abstractile_defaults [] = {
   "*sleep:             3",
   "*speed:             3",
   "*tile:         random",
-#ifdef USE_IPHONE
+#ifdef HAVE_MOBILE
   "*ignoreRotation: True",
 #endif
   0