projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://ftp.x.org/contrib/applications/xscreensaver-3.22.tar.gz
[xscreensaver]
/
hacks
/
hypercube.c
diff --git
a/hacks/hypercube.c
b/hacks/hypercube.c
index c58906e4a1bebaa2d9a8ae987bf4dba966dd99fe..5150ec3bdfbc130e49f6bf6ae4c66ba03ffc85cd 100644
(file)
--- a/
hacks/hypercube.c
+++ b/
hacks/hypercube.c
@@
-1,4
+1,5
@@
-/* 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
*
* 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.
*/
* and Jamie Zawinski.
*/
-#include "screenhack.h"
#include <math.h>
#include <math.h>
+#include "screenhack.h"
static Display *dpy;
static Window window;
static Display *dpy;
static Window window;
@@
-33,9
+34,7
@@
struct point_state {
};
static void
};
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;
{
if (state0->same_p && state1->same_p)
return;
@@
-58,8
+57,7
@@
move_line (state0, state1, gc)
}
static void
}
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 cos_xy = cos (xy), sin_xy = sin (xy);
double cos_xz = cos (xz), sin_xz = sin (xz);
@@
-76,7
+74,7
@@
hyper (xy, xz, yz, xw, yw, zw)
double _tmp0_, _tmp1_;
struct point_state points [16];
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])
#define mmmm (&points[0])
#define mmmp (&points[1])
@@
-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.
*/
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)); \
# define rotate(name,dim0,dim1,cos,sin) \
_tmp0_ = ((name##dim0 * cos) + (name##dim1 * sin)); \
_tmp1_ = ((name##dim1 * cos) - (name##dim0 * sin)); \
@@
-212,7
+210,8
@@
hyper (xy, xz, yz, xw, yw, zw)
rotates (y,w);
rotates (z,w);
rotates (y,w);
rotates (z,w);
- XSync (dpy, True);
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
if (delay) usleep (delay);
}
}
if (delay) usleep (delay);
}
}
@@
-221,8
+220,8
@@
hyper (xy, xz, yz, xw, yw, zw)
char *progclass = "Hypercube";
char *defaults [] = {
char *progclass = "Hypercube";
char *defaults [] = {
- "
*
background: black",
- "
*
foreground: white",
+ "
.
background: black",
+ "
.
foreground: white",
"*color0: red",
"*color1: orange",
"*color2: yellow",
"*color0: red",
"*color1: orange",
"*color2: yellow",
@@
-240,7
+239,7
@@
char *defaults [] = {
"*zw: 0.000",
"*observer-z: 5",
"*zw: 0.000",
"*observer-z: 5",
- "*delay:
10
0000",
+ "*delay:
3
0000",
0
};
0
};
@@
-262,22
+261,18
@@
XrmOptionDescRec options [] = {
{ "-zw", ".zw", XrmoptionSepArg, 0 },
{ "-observer-z", ".observer-z", XrmoptionSepArg, 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
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;
{
XGCValues gcv;
XWindowAttributes xgwa;
Colormap cmap;
double xy, xz, yz, xw, yw, zw;
- unsigned long bg
, pixel
;
+ unsigned long bg;
dpy = d;
window = w;
dpy = d;
window = w;