projects
/
xscreensaver
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.21.tar.gz
[xscreensaver]
/
hacks
/
metaballs.c
diff --git
a/hacks/metaballs.c
b/hacks/metaballs.c
index cc8047936b79cfc6224c0978ca6d73c0d6c0e136..f867b2906aa0462e7e5946397f42b5d6d98cfc2e 100644
(file)
--- a/
hacks/metaballs.c
+++ b/
hacks/metaballs.c
@@
-56,7
+56,7
@@
typedef struct
short xpos,ypos;
} BLOB;
short xpos,ypos;
} BLOB;
-static unsigned
char
nBlobCount;
+static unsigned
int
nBlobCount;
static unsigned char radius;
static unsigned char delta;
static unsigned char dradius;
static unsigned char radius;
static unsigned char delta;
static unsigned char dradius;
@@
-65,10
+65,13
@@
static unsigned char **blob;
static BLOB *blobs;
static unsigned char **blub;
static BLOB *blobs;
static unsigned char **blub;
+#undef BELLRAND
+#define BELLRAND(n) ((frand((n)) + frand((n)) + frand((n))) / 3)
+
static void init_blob(BLOB *blob)
{
static void init_blob(BLOB *blob)
{
- blob->xpos =
(iWinWidth>> 1)
- radius;
- blob->ypos =
(iWinHeight >> 1
) - radius;
+ blob->xpos =
iWinWidth/4 + BELLRAND(iWinWidth/2)
- radius;
+ blob->ypos =
iWinHeight/4 + BELLRAND(iWinHeight/2
) - radius;
}
static void Execute( Display *pDisplay,
}
static void Execute( Display *pDisplay,