projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
http://www.jwz.org/xscreensaver/xscreensaver-5.09.tar.gz
[xscreensaver]
/
hacks
/
goop.c
diff --git
a/hacks/goop.c
b/hacks/goop.c
index 4241950c0c386dc43a4cef014fb2358cf6c69a84..d2308386d6551101aecb180cbca173740c16c0dc 100644
(file)
--- a/
hacks/goop.c
+++ b/
hacks/goop.c
@@
-1,4
+1,4
@@
-/* xscreensaver, Copyright (c) 1997
, 2006
Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1997
-2008
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
@@
-47,7
+47,6
@@
#define SCALE 10000 /* fixed-point math, for sub-pixel motion */
#define DEF_COUNT 12 /* When planes and count are 0, how many blobs. */
#define SCALE 10000 /* fixed-point math, for sub-pixel motion */
#define DEF_COUNT 12 /* When planes and count are 0, how many blobs. */
-
#define RAND(n) ((long) ((random() & 0x7fffffff) % ((long) (n))))
#define RANDSIGN() ((random() & 1) ? 1 : -1)
#define RAND(n) ((long) ((random() & 0x7fffffff) % ((long) (n))))
#define RANDSIGN() ((random() & 1) ? 1 : -1)
@@
-126,7
+125,7
@@
make_blob (Display *dpy, int maxx, int maxy, int size)
b->spline = make_spline (b->npoints);
b->r = (long *) malloc (sizeof(*b->r) * b->npoints);
for (i = 0; i < b->npoints; i++)
b->spline = make_spline (b->npoints);
b->r = (long *) malloc (sizeof(*b->r) * b->npoints);
for (i = 0; i < b->npoints; i++)
- b->r[i] = ((random() % mid) + (mid/2)) * RANDSIGN();
+ b->r[i] = (
long) (
(random() % mid) + (mid/2)) * RANDSIGN();
return b;
}
return b;
}
@@
-258,9
+257,11
@@
make_layer (Display *dpy, Window window, int width, int height, int nblobs)
blob_max = (width < height ? width : height) / 2;
blob_min = (blob_max * 2) / 3;
blob_max = (width < height ? width : height) / 2;
blob_min = (blob_max * 2) / 3;
- for (i = 0; i < layer->nblobs; i++)
+ for (i = 0; i < layer->nblobs; i++){
+ int j = blob_max - blob_min;
layer->blobs[i] = make_blob (dpy, width, height,
layer->blobs[i] = make_blob (dpy, width, height,
- (random() % (blob_max-blob_min)) + blob_min);
+ (j ? random() % j : 0) + blob_min);
+ }
layer->pixmap = XCreatePixmap (dpy, window, width, height, 1);
layer->gc = XCreateGC (dpy, layer->pixmap, 0, &gcv);
layer->pixmap = XCreatePixmap (dpy, window, width, height, 1);
layer->gc = XCreateGC (dpy, layer->pixmap, 0, &gcv);
@@
-564,8
+565,8
@@
static const char *goop_defaults [] = {
"*delay: 12000",
"*additive: true",
"*mode: transparent",
"*delay: 12000",
"*additive: true",
"*mode: transparent",
- "*count:
0
",
- "*planes:
0
",
+ "*count:
1
",
+ "*planes:
12
",
"*thickness: 5",
"*torque: 0.0075",
"*elasticity: 0.9",
"*thickness: 5",
"*torque: 0.0075",
"*elasticity: 0.9",