projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://packetstormsecurity.org/UNIX/admin/xscreensaver-3.28.tar.gz
[xscreensaver]
/
hacks
/
qix.c
diff --git
a/hacks/qix.c
b/hacks/qix.c
index ed3ac0a05b68a95a8c8fff5c63ddf2b700319e77..44c85ec3051d24aac5aaf43a3c9d5ee25b2d3d4e 100644
(file)
--- a/
hacks/qix.c
+++ b/
hacks/qix.c
@@
-1,5
+1,5
@@
-/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997
- * Jamie Zawinski <jwz@
netscape.com
>
+/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997
, 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
@@
-18,8
+18,8
@@
#define SCALE 6
struct qpoint {
#define SCALE 6
struct qpoint {
-
long
x, y;
-
long
dx, dy;
+
int
x, y;
+
int
dx, dy;
};
struct qline {
};
struct qline {
@@
-45,6
+45,9
@@
static int delay;
static int count;
static Colormap cmap;
static int npoly;
static int count;
static Colormap cmap;
static int npoly;
+static Bool additive_p;
+static Bool cmap_p;
+
static GC *gcs[2];
static GC *gcs[2];
@@
-192,15
+195,18
@@
init_qix (Display *dpy, Window window)
gcv.foreground = default_fg_pixel =
get_pixel_resource ("foreground", "Foreground", dpy, cmap);
gcv.foreground = default_fg_pixel =
get_pixel_resource ("foreground", "Foreground", dpy, cmap);
+ additive_p = get_boolean_resource ("additive", "Boolean");
+ cmap_p = has_writable_cells (xgwa.screen, xgwa.visual);
+
if (transparent_p)
{
if (transparent_p)
{
- Bool additive_p = get_boolean_resource ("additive", "Boolean");
unsigned long *plane_masks = 0;
unsigned long base_pixel;
int nplanes = count;
int i;
unsigned long *plane_masks = 0;
unsigned long base_pixel;
int nplanes = count;
int i;
- allocate_alpha_colors (dpy, cmap, &nplanes, additive_p, &plane_masks,
+ allocate_alpha_colors (xgwa.screen, xgwa.visual, cmap,
+ &nplanes, additive_p, &plane_masks,
&base_pixel);
if (nplanes <= 1)
&base_pixel);
if (nplanes <= 1)
@@
-230,6
+236,12
@@
init_qix (Display *dpy, Window window)
{
gcv.plane_mask = plane_masks [i];
gcv.foreground = ~0;
{
gcv.plane_mask = plane_masks [i];
gcv.foreground = ~0;
+
+/* argh, I'm not sure how to make "-subtractive" work in truecolor...
+ if (!cmap_p && !additive_p)
+ gcv.function = GXclear;
+ */
+
if (xor_p)
{
gcv.function = GXxor;
if (xor_p)
{
gcv.function = GXxor;
@@
-454,8
+466,8
@@
qix1 (Display *dpy, Window window, struct qix *qix)
char *progclass = "Qix";
char *defaults [] = {
char *progclass = "Qix";
char *defaults [] = {
- "
Qix.background: black", /* to placate SGI */
- "
Qix.foreground:
white",
+ "
.background: black",
+ "
.foreground:
white",
"*count: 1",
"*segments: 50",
"*poly: 2",
"*count: 1",
"*segments: 50",
"*poly: 2",
@@
-504,7
+516,8
@@
screenhack (Display *dpy, Window window)
for (qn = q1; *qn; qn++)
{
qix1 (dpy, window, *qn);
for (qn = q1; *qn; qn++)
{
qix1 (dpy, window, *qn);
- XSync (dpy, True);
+ XSync (dpy, False);
+ screenhack_handle_events (dpy);
if (delay) usleep (delay);
}
}
if (delay) usleep (delay);
}
}