- get_geom (dpy, window);
- max_spread = get_integer_resource ("spread", "Integer");
- if (max_spread <= 0) max_spread = 10;
- max_size = get_integer_resource ("size", "Integer");
- if (max_size < 0) max_size = 0;
- random_p = get_boolean_resource ("random", "Boolean");
- solid_p = get_boolean_resource ("solid", "Boolean");
- xor_p = get_boolean_resource ("xor", "Boolean");
- transparent_p = get_boolean_resource ("transparent", "Boolean");
- delay = get_integer_resource ("delay", "Integer");
- color_shift = get_integer_resource ("colorShift", "Integer");
- if (color_shift < 0 || color_shift >= 360) color_shift = 5;
- if (delay < 0) delay = 0;
-
- if (count == 1 && transparent_p)
- transparent_p = False; /* it's a no-op */
-
- if (transparent_p && CellsOfScreen (DefaultScreenOfDisplay (dpy)) <= 2)
+ st->npoly = get_integer_resource(st->dpy, "poly", "Integer");
+ if (st->npoly <= 2) st->npoly = 2;
+ if (st->npoly > MAXPOLY) st->npoly = MAXPOLY;
+ get_geom (st);
+ st->max_spread = get_integer_resource (st->dpy, "spread", "Integer");
+ if (st->max_spread <= 0) st->max_spread = 10;
+ st->max_spread <<= SCALE;
+ st->max_size = get_integer_resource (st->dpy, "size", "Integer");
+ if (st->max_size < 0) st->max_size = 0;
+ st->max_size <<= SCALE;
+ st->random_p = get_boolean_resource (st->dpy, "random", "Boolean");
+ st->solid_p = get_boolean_resource (st->dpy, "solid", "Boolean");
+ st->xor_p = get_boolean_resource (st->dpy, "xor", "Boolean");
+ st->transparent_p = get_boolean_resource (st->dpy, "transparent", "Boolean");
+ st->gravity_p = get_boolean_resource(st->dpy, "gravity", "Boolean");
+ st->delay = get_integer_resource (st->dpy, "delay", "Integer");
+ st->color_shift = get_integer_resource (st->dpy, "colorShift", "Integer");
+ if (st->color_shift < 0 || st->color_shift >= 360) st->color_shift = 5;
+ if (st->delay < 0) st->delay = 0;
+
+ /* Clear up ambiguities regarding npoly */
+ if (st->solid_p)
+ {
+ if (st->npoly != 2)
+ fprintf(stderr, "%s: Can't have -solid and -poly; using -poly 2\n",
+ progname);
+ st->npoly = 2;
+ }
+ if (st->npoly > 2)
+ {
+ if (st->max_size)
+ fprintf(stderr, "%s: Can't have -poly and -size; using -size 0\n",
+ progname);
+ st->max_size = 0;
+ }
+
+ if (st->count == 1 && st->transparent_p)
+ st->transparent_p = False; /* it's a no-op */
+
+ if (st->transparent_p && CellsOfScreen (DefaultScreenOfDisplay (st->dpy)) <= 2)