-/* xscreensaver, Copyright (c) 1992, 1995, 1996, 1997, 1998, 2001, 2006
- * Jamie Zawinski <jwz@jwz.org>
+/* xscreensaver, Copyright (c) 1992-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
if(st->cbounce_p) /* with correct bouncing */
{
/* so long as it's out of range, keep bouncing */
+ /* limit the maximum number to bounce to 4.*/
+ int bounce_allowed = 4;
- while( (st->balls[i].x >= (st->xlim - st->balls[i].size)) ||
+ while( bounce_allowed && (
+ (st->balls[i].x >= (st->xlim - st->balls[i].size)) ||
(st->balls[i].y >= (st->ylim - st->balls[i].size)) ||
(st->balls[i].x <= 0) ||
(st->balls[i].y <= 0) )
+ )
{
+ bounce_allowed--;
if (st->balls[i].x >= (st->xlim - st->balls[i].size))
{
st->balls[i].x = (2*(st->xlim - st->balls[i].size) - st->balls[i].x);
static const char *attraction_defaults [] = {
".background: black",
".foreground: white",
+ "*fpsSolid: true",
"*mode: balls",
"*graphmode: none",
"*points: 0",
"*maxspeed: true",
"*cbounce: true",
"*mouse: false",
- "*viscosity: 1",
+ "*viscosity: 1.0",
"*orbit: false",
"*colorShift: 3",
"*segments: 500",