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.03.tar.gz
[xscreensaver]
/
hacks
/
rorschach.c
diff --git
a/hacks/rorschach.c
b/hacks/rorschach.c
old mode 100755
(executable)
new mode 100644
(file)
index
bb17ffc
..
3c1a20e
--- a/
hacks/rorschach.c
+++ b/
hacks/rorschach.c
@@
-1,4
+1,4
@@
-/* xscreensaver, Copyright (c) 1992
Jamie Zawinski <jwz@mcom.com
>
+/* xscreensaver, Copyright (c) 1992
, 1996 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
@@
-7,19
+7,22
@@
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
* documentation. No representations are made about the suitability of this
* software for any purpose. It is provided "as is" without express or
* implied warranty.
+ *
+ * 19971004: Johannes Keukelaar <johannes@nada.kth.se>: Use helix screen
+ * eraser.
*/
#include "screenhack.h"
*/
#include "screenhack.h"
+#include "erase.h"
static GC draw_gc, erase_gc;
static unsigned int default_fg_pixel;
static int iterations, offset;
static Bool xsym, ysym;
static GC draw_gc, erase_gc;
static unsigned int default_fg_pixel;
static int iterations, offset;
static Bool xsym, ysym;
+static int sleep_time;
static void
static void
-init_rorschach (dpy, window)
- Display *dpy;
- Window window;
+init_rorschach (Display *dpy, Window window)
{
XGCValues gcv;
Colormap cmap;
{
XGCValues gcv;
Colormap cmap;
@@
-40,9
+43,7
@@
init_rorschach (dpy, window)
}
static void
}
static void
-hurm (dpy, window)
- Display *dpy;
- Window window;
+hurm (Display *dpy, Window window)
{
Colormap cmap;
XWindowAttributes xgwa;
{
Colormap cmap;
XWindowAttributes xgwa;
@@
-93,15
+94,10
@@
hurm (dpy, window)
XDrawPoints (dpy, window, draw_gc, points, j, CoordModeOrigin);
XSync (dpy, True);
}
XDrawPoints (dpy, window, draw_gc, points, j, CoordModeOrigin);
XSync (dpy, True);
}
- sleep (5);
- for (i = 0; i < (ylim >> 1); i++)
- {
- int y = (random () % ylim);
- XDrawLine (dpy, window, erase_gc, 0, y, xlim, y);
- XFlush (dpy);
- if ((i % 50) == 0)
- usleep (10000);
- }
+ sleep ( sleep_time );
+
+ erase_full_window(dpy, window);
+
XClearWindow (dpy, window);
if (got_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
XSync (dpy, True);
XClearWindow (dpy, window);
if (got_color) XFreeColors (dpy, cmap, &color.pixel, 1, 0);
XSync (dpy, True);
@@
-112,12
+108,13
@@
hurm (dpy, window)
char *progclass = "Rorschach";
char *defaults [] = {
char *progclass = "Rorschach";
char *defaults [] = {
- "
Rorschach.background: black", /* to placate SGI */
- "
Rorschach.foreground:
white",
+ "
.background: black",
+ "
.foreground:
white",
"*xsymmetry: true",
"*ysymmetry: false",
"*iterations: 4000",
"*offset: 4",
"*xsymmetry: true",
"*ysymmetry: false",
"*iterations: 4000",
"*offset: 4",
+ "*delay: 5",
0
};
0
};
@@
-125,15
+122,16
@@
XrmOptionDescRec options [] = {
{ "-iterations", ".iterations", XrmoptionSepArg, 0 },
{ "-offset", ".offset", XrmoptionSepArg, 0 },
{ "-xsymmetry", ".xsymmetry", XrmoptionNoArg, "true" },
{ "-iterations", ".iterations", XrmoptionSepArg, 0 },
{ "-offset", ".offset", XrmoptionSepArg, 0 },
{ "-xsymmetry", ".xsymmetry", XrmoptionNoArg, "true" },
- { "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" }
+ { "-ysymmetry", ".ysymmetry", XrmoptionNoArg, "true" },
+ { "-erase-speed", ".eraseSpeed", XrmoptionSepArg, 0 },
+ { "-delay", ".delay", XrmoptionSepArg, 0 },
+ { 0, 0, 0, 0 }
};
};
-int options_size = (sizeof (options) / sizeof (options[0]));
void
void
-screenhack (dpy, window)
- Display *dpy;
- Window window;
+screenhack (Display *dpy, Window window)
{
{
+ sleep_time = get_integer_resource("delay", "Integer");
init_rorschach (dpy, window);
while (1)
hurm (dpy, window);
init_rorschach (dpy, window);
while (1)
hurm (dpy, window);