X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fmetaballs.c;h=f867b2906aa0462e7e5946397f42b5d6d98cfc2e;hp=d814a80c29cd4ddabd5e44d2e90cea825ef740d3;hb=bc7b7a8eb122206d239ec0e693676bcce31be1aa;hpb=ffd8c0873576a9e3065696a624dce6b766b77062 diff --git a/hacks/metaballs.c b/hacks/metaballs.c index d814a80c..f867b290 100644 --- a/hacks/metaballs.c +++ b/hacks/metaballs.c @@ -65,10 +65,13 @@ static unsigned char **blob; 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) { - 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,