From http://www.jwz.org/xscreensaver/xscreensaver-5.35.tar.gz
[xscreensaver] / hacks / whirlwindwarp.c
index d76d5ed250c39746a0bdc9e89a0155cf63232d2c..3525e498b134c5461d4a4d230332387c0b3b276e 100644 (file)
@@ -447,7 +447,8 @@ whirlwindwarp_draw (Display *dpy, Window window, void *closure)
         struct timeval now;
         long timediff;
         gettimeofday(&now, NULL);
-        timediff = now.tv_sec*1000000 + now.tv_usec - st->lastframe.tv_sec*1000000 - st->lastframe.tv_usec;
+        /* timediff = now.tv_sec*1000000 + now.tv_usec - st->lastframe.tv_sec*1000000 - st->lastframe.tv_usec; */
+        timediff = (now.tv_sec - st->lastframe.tv_sec) * 1000000 + now.tv_usec - st->lastframe.tv_usec;
         if (timediff < utimeperframe) {
           /* fprintf(stderr,"sleeping for %i\n",utimeperframe-timediff); */
           this_delay = (utimeperframe-timediff);
@@ -463,6 +464,9 @@ static void
 whirlwindwarp_reshape (Display *dpy, Window window, void *closure, 
                  unsigned int w, unsigned int h)
 {
+  struct state *st = (struct state *) closure;
+  st->scrwid = w;
+  st->scrhei = h;
 }
 
 static Bool
@@ -482,9 +486,13 @@ whirlwindwarp_free (Display *dpy, Window window, void *closure)
 static const char *whirlwindwarp_defaults [] = {
   ".background:        black",
   ".foreground:        white",
+  "*fpsSolid:  true",
   "*points:    400",
   "*tails:     8",
   "*meters:    false",
+#ifdef HAVE_MOBILE
+  "*ignoreRotation: True",
+#endif
   0
 };
 
@@ -495,4 +503,4 @@ static XrmOptionDescRec whirlwindwarp_options [] = {
   { 0, 0, 0, 0 }
 };
 
-XSCREENSAVER_MODULE ("Whirlwindwarp", whirlwindwarp)
+XSCREENSAVER_MODULE ("WhirlWindWarp", whirlwindwarp)