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.06.tar.gz
[xscreensaver]
/
hacks
/
bubbles.c
diff --git
a/hacks/bubbles.c
b/hacks/bubbles.c
index 99e64b10d1b3cbb2e34f4b9568242d1fc96ac26a..913fe03726df2c676d19b80902dfd24cbdb2a5db 100644
(file)
--- a/
hacks/bubbles.c
+++ b/
hacks/bubbles.c
@@
-1,6
+1,6
@@
/* bubbles.c - frying pan / soft drink in a glass simulation */
/* bubbles.c - frying pan / soft drink in a glass simulation */
-/*$Id: bubbles.c,v 1.1
3 1998/02/21 21:55:14
jwz Exp $*/
+/*$Id: bubbles.c,v 1.1
6 1998/11/19 07:25:01
jwz Exp $*/
/*
* Copyright (C) 1995-1996 James Macnicol
/*
* Copyright (C) 1995-1996 James Macnicol
@@
-76,8
+76,8
@@
extern char **default_bubbles[];
char *progclass = "Bubbles";
char *defaults [] = {
char *progclass = "Bubbles";
char *defaults [] = {
- "
Bubbles.background:
black",
- "
*
foreground: white",
+ "
.background:
black",
+ "
.
foreground: white",
"*simple: false",
"*broken: false",
"*delay: 800",
"*simple: false",
"*broken: false",
"*delay: 800",
@@
-506,8
+506,8
@@
size. */
}
rv->visible = 0;
rv->magic = BUBBLE_MAGIC;
}
rv->visible = 0;
rv->magic = BUBBLE_MAGIC;
- rv->x =
ya_
random() % screen_width;
- rv->y =
ya_
random() % screen_height;
+ rv->x = random() % screen_width;
+ rv->y = random() % screen_height;
rv->cell_index = pixel_to_mesh(rv->x, rv->y);
return rv;
rv->cell_index = pixel_to_mesh(rv->x, rv->y);
return rv;
@@
-837,7
+837,7
@@
merge_bubbles(Bubble *b1, Bubble *b2)
break;
}
} else {
break;
}
} else {
- if ((
ya_
random() % 2) == 0) {
+ if ((random() % 2) == 0) {
switch (bubble_eat(b1, b2)) {
case 0:
return 0;
switch (bubble_eat(b1, b2)) {
case 0:
return 0;
@@
-1218,8
+1218,6
@@
init_bubbles (Display *dpy, Window window)
defdsp = dpy;
defwin = window;
defdsp = dpy;
defwin = window;
- ya_rand_init(0);
-
get_resources(dpy, window);
XGetWindowAttributes (dpy, window, &xgwa);
get_resources(dpy, window);
XGetWindowAttributes (dpy, window, &xgwa);
@@
-1304,7
+1302,7
@@
bubbles (Display *dpy, Window window)
add_to_mesh(tmp);
insert_new_bubble(tmp);
add_to_mesh(tmp);
insert_new_bubble(tmp);
- XSync (dpy,
Tru
e);
+ XSync (dpy,
Fals
e);
}
}
@@
-1314,6
+1312,7
@@
screenhack (Display *dpy, Window window)
init_bubbles (dpy, window);
while (1) {
bubbles (dpy, window);
init_bubbles (dpy, window);
while (1) {
bubbles (dpy, window);
+ screenhack_handle_events (dpy);
if (delay)
usleep(delay);
}
if (delay)
usleep(delay);
}