-/* xscreensaver, Copyright (c) 1992 Jamie Zawinski <jwz@lucid.com>
+/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1998
+ * 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
* and Jamie Zawinski.
*/
-#include "screenhack.h"
#include <math.h>
+#include "screenhack.h"
static Display *dpy;
static Window window;
};
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;
}
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);
double _tmp0_, _tmp1_;
struct point_state points [16];
- bzero (points, sizeof (points));
+ memset (points, 0, sizeof (points));
#define mmmm (&points[0])
#define mmmp (&points[1])
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)); \
rotates (y,w);
rotates (z,w);
- XSync (dpy, True);
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
if (delay) usleep (delay);
}
}
char *progclass = "Hypercube";
char *defaults [] = {
- "*background: black",
- "*foreground: white",
+ ".background: black",
+ ".foreground: white",
"*color0: red",
"*color1: orange",
"*color2: yellow",
"*zw: 0.000",
"*observer-z: 5",
- "*delay: 100000",
+ "*delay: 30000",
0
};
{ "-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;
Colormap cmap;
double xy, xz, yz, xw, yw, zw;
- unsigned long bg, pixel;
+ unsigned long bg;
dpy = d;
window = w;