http://ftp.x.org/contrib/applications/xscreensaver-3.02.tar.gz
[xscreensaver] / hacks / flame.c
index d723f055e8cee09572da6171878936590a477f99..521d3cb7400f6b525554d299e770404e56530d22 100644 (file)
@@ -1,5 +1,5 @@
 /* xscreensaver, Copyright (c) 1993, 1995, 1996
- *  Jamie Zawinski <jwz@netscape.com>
+ *  Jamie Zawinski <jwz@jwz.org>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -175,6 +175,14 @@ recurse (double x, double y, int l, Display *dpy, Window win)
     {
       for (i = 0; i < snum; i++)
        {
+
+         /* Scale back when values get very large. Spot sez:
+            "I think this happens on HPUX.  I think it's non-IEEE
+            to generate an exception instead of a silent NaN."
+          */
+         if ((abs(x) > 1.0E5) || (abs(y) > 1.0E5))
+           x = x / y;
+
          nx = f[0][0][i] * x + f[0][1][i] * y + f[0][2][i];
          ny = f[1][0][i] * x + f[1][1][i] * y + f[1][2][i];
          if (i < anum)
@@ -373,8 +381,8 @@ int matherr(x)
 char *progclass = "Flame";
 
 char *defaults [] = {
-  "Flame.background:   black",         /* to placate SGI */
-  "Flame.foreground:   white",
+  ".background:        black",
+  ".foreground:        white",
   "*colors:    64",
   "*iterations:        25",
   "*delay:     50000",