From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / intermomentary.c
index 0c0ac4c8f5c880eb6793446d5ee5e313ac676512..96c6b29dbdb0c7ffb1e6d01036eebf7a01942cda 100644 (file)
@@ -224,8 +224,8 @@ draw_glowpoint(struct state *st, Drawable drawable,
     float a;
     unsigned long c;
 
-    for (i =2; i < 3; i++) {
-        for (j =2; j < 3; j++) {
+    for (i = -2; i < 3; i++) {
+        for (j = -2; j < 3; j++) {
             a = 0.8 - i * i * 0.1 - j * j * 0.1;
 
             c = trans_point(st, px+i, py+j, 255, a, f);
@@ -251,7 +251,7 @@ moverender_rider(struct state *st, Drawable drawable,
     rid->vt += frand(0.002) - 0.001;
 
     /* apply friction brakes */
-    if (abs(rid->vt) > 0.02)
+    if (fabsf(rid->vt) > 0.02)
         rid->vt *= 0.9;
 
     /* draw */
@@ -302,7 +302,7 @@ render_disc(struct state *st, Drawable drawable, GC fgc, struct field *f, int dn
         /* intersection test */
         if (d < (f->discs[n].r + di->r)) {
             /* complete containment test */
-            if (d > abs(f->discs[n].r - di->r)) {
+            if (d > fabsf(f->discs[n].r - di->r)) {
                 /* find solutions */
                 a = (di->r * di->r - f->discs[n].r * f->discs[n].r + d * d) / (2 * d);
                 p2x = di->x + a * (f->discs[n].x - di->x) / d;
@@ -360,7 +360,8 @@ static void build_img(Display *dpy, Window window, struct field *f)
 
     memset(f->off_alpha, 0, sizeof(unsigned char) * f->width * f->height);
 
-# ifdef HAVE_COCOA     /* Don't second-guess Quartz's double-buffering */
+# ifdef HAVE_JWXYZ     /* Don't second-guess Quartz's double-buffering */
+                        /* Or Android's */
     f->off_map = window;
 # else
     f->off_map = XCreatePixmap(dpy, window, f->width, f->height, f->visdepth);
@@ -419,7 +420,7 @@ intermomentary_init (Display *dpy, Window window)
       bgs = fgs;
       bgv = fgv / 10.0;
 #endif
-      make_color_ramp (st->dpy, st->xgwa.colormap,
+      make_color_ramp (st->xgwa.screen, st->xgwa.visual, st->xgwa.colormap,
                        bgh, bgs, bgv,
                        fgh, fgs, fgv,
                        st->colors, &st->ncolors,
@@ -554,6 +555,9 @@ static const char *intermomentary_defaults[] = {
     "*maxRiders: 40",
     "*maxRadius: 100",
     "*colors: 256",
+# ifdef HAVE_MOBILE
+    "*ignoreRotation: True",
+# endif
     0
 };