http://ftp.x.org/contrib/applications/xscreensaver-2.23.tar.gz
[xscreensaver] / hacks / hypercube.c
index e2e71a6b833dca3dd90f1ad860529978539fbd28..6ad94a83c9c28ac09f455ad56d6751084f306209 100644 (file)
@@ -1,4 +1,5 @@
-/* xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@mcom.com>
+/* xscreensaver, Copyright (c) 1992, 1995, 1996
+ *  Jamie Zawinski <jwz@netscape.com>
  *
  * Permission to use, copy, modify, distribute, and sell this software and its
  * documentation for any purpose is hereby granted without fee, provided that
@@ -12,8 +13,8 @@
  * and Jamie Zawinski.
  */
 
-#include "screenhack.h"
 #include <math.h>
+#include "screenhack.h"
 
 static Display *dpy;
 static Window window;
@@ -33,9 +34,7 @@ struct point_state {
 };
 
 static void
-move_line (state0, state1, gc)
-     struct point_state *state0, *state1;
-     GC gc;
+move_line (struct point_state *state0, struct point_state *state1, GC gc)
 {
   if (state0->same_p && state1->same_p)
     return;
@@ -58,8 +57,7 @@ move_line (state0, state1, gc)
 }
 
 static void
-hyper (xy, xz, yz, xw, yw, zw)
-     double xy, xz, yz, xw, yw, zw;
+hyper (double xy, double xz, double yz, double xw, double yw, double zw)
 {
   double cos_xy = cos (xy), sin_xy = sin (xy);
   double cos_xz = cos (xz), sin_xz = sin (xz);
@@ -174,7 +172,7 @@ hyper (xy, xz, yz, xw, yw, zw)
     mixing an ANSI compiler with a non-ANSI preprocessor, or vice versa.
     Regardless, your system is broken; it's not a bug in this program.
   */
-#if __STDC__
+#if defined(__STDC__) || defined(__ANSI_CPP__)
 # define rotate(name,dim0,dim1,cos,sin) \
       _tmp0_ = ((name##dim0 * cos) + (name##dim1 * sin)); \
       _tmp1_ = ((name##dim1 * cos) - (name##dim0 * sin)); \
@@ -221,8 +219,8 @@ hyper (xy, xz, yz, xw, yw, zw)
 char *progclass = "Hypercube";
 
 char *defaults [] = {
-  "Hypercube.background:       black",         /* to placate SGI */
-  "Hypercube.foreground:       white",
+  ".background:        black",
+  ".foreground:        white",
   "*color0:    red",
   "*color1:    orange",
   "*color2:    yellow",
@@ -240,7 +238,7 @@ char *defaults [] = {
   "*zw:                0.000",
 
   "*observer-z:        5",
-  "*delay:     100000",
+  "*delay:     30000",
   0
 };
 
@@ -262,16 +260,12 @@ XrmOptionDescRec options [] = {
   { "-zw",             ".zw",          XrmoptionSepArg, 0 },
 
   { "-observer-z",     ".observer-z",  XrmoptionSepArg, 0 },
-  { "-delay",          ".delay",       XrmoptionSepArg, 0 }
+  { "-delay",          ".delay",       XrmoptionSepArg, 0 },
+  { 0, 0, 0, 0 }
 };
 
-int options_size = (sizeof (options) / sizeof (options[0]));
-
-
 void
-screenhack (d, w)
-     Display *d;
-     Window w;
+screenhack (Display *d, Window w)
 {
   XGCValues gcv;
   XWindowAttributes xgwa;