X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fstarfish.c;h=5e94144401a4d51ce67e681f8481a2ca0b720534;hb=39809ded547bdbb08207d3e514950425215b4410;hp=6cfee31db8ddcb89a46fdb174cfd36c180056e53;hpb=4ade52359b6eba3621566dac79793a33aa4c915f;p=xscreensaver diff --git a/hacks/starfish.c b/hacks/starfish.c index 6cfee31d..5e941444 100644 --- a/hacks/starfish.c +++ b/hacks/starfish.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1997-2013 Jamie Zawinski +/* xscreensaver, Copyright (c) 1997-2015 Jamie Zawinski * * Permission to use, copy, modify, distribute, and sell this software and its * documentation for any purpose is hereby granted without fee, provided that @@ -71,7 +71,6 @@ make_starfish (struct state *st, int maxx, int maxy, int size) { struct starfish *s = (struct starfish *) calloc(1, sizeof(*s)); int i; - int mid; s->blob_p = st->blob_p; s->elasticity = SCALE * get_float_resource (st->dpy, "thickness", "Thickness"); @@ -121,7 +120,6 @@ make_starfish (struct state *st, int maxx, int maxy, int size) s->min_r = 0; if (s->min_r < (5*SCALE)) s->min_r = (5*SCALE); - mid = ((s->min_r + s->max_r) / 2); s->x = maxx/2; s->y = maxy/2; @@ -324,6 +322,13 @@ make_window_starfish (struct state *st) size = (xgwa.width < xgwa.height ? xgwa.width : xgwa.height); if (st->blob_p) size /= 2; else size *= 1.3; + + if (xgwa.width < 100 || xgwa.height < 100) /* tiny window */ + { + size = (xgwa.width > xgwa.height ? xgwa.width : xgwa.height); + if (size < 100) size = 100; + } + return make_starfish (st, xgwa.width, xgwa.height, size); } @@ -390,6 +395,10 @@ reset_starfish (struct state *st) flags |= GCFillRule; gcv.fill_rule = EvenOddRule; st->gc = XCreateGC (st->dpy, st->window, flags, &gcv); +#ifdef HAVE_JWXYZ + if (!st->blob_p) + jwxyz_XSetAntiAliasing (st->dpy, st->gc, False); +#endif return make_window_starfish (st); } @@ -469,8 +478,8 @@ starfish_draw (Display *dpy, Window window, void *closure) if (st->duration > 0) { if (st->start_time == 0) - st->start_time = time ((time_t) 0); - now = time ((time_t) 0); + st->start_time = time ((time_t *) 0); + now = time ((time_t *) 0); if (st->start_time + st->duration < now) { st->start_time = now; @@ -528,7 +537,7 @@ static const char *starfish_defaults [] = { "*duration: 30", "*delay2: 5", "*mode: random", -#ifdef USE_IPHONE +#ifdef HAVE_MOBILE "*ignoreRotation: True", #endif 0