X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fstarfish.c;h=5fa3395e9aa979f72ab07752df1a47f326096185;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=b192e280dcbbab4a7481dc05b963275cd671ab24;hpb=c494fd2e6b3b25582375d62e40f4f5cc984ca424;p=xscreensaver diff --git a/hacks/starfish.c b/hacks/starfish.c index b192e280..5fa3395e 100644 --- a/hacks/starfish.c +++ b/hacks/starfish.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1997-2007 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; @@ -341,7 +339,7 @@ reset_starfish (struct state *st) if (st->done_once) { if (st->colors && st->ncolors) - free_colors (st->dpy, st->cmap, st->colors, st->ncolors); + free_colors (xgwa.screen, st->cmap, st->colors, st->ncolors); if (st->colors) free (st->colors); st->colors = 0; @@ -361,10 +359,12 @@ reset_starfish (struct state *st) if (mono_p) ; else if (random() % 3) - make_smooth_colormap (st->dpy, xgwa.visual, st->cmap, st->colors, &st->ncolors, + make_smooth_colormap (xgwa.screen, xgwa.visual, st->cmap, + st->colors, &st->ncolors, True, 0, True); else - make_uniform_colormap (st->dpy, xgwa.visual, st->cmap, st->colors, &st->ncolors, + make_uniform_colormap (xgwa.screen, xgwa.visual, st->cmap, + st->colors, &st->ncolors, True, 0, True); if (st->ncolors < 2) st->ncolors = 2; @@ -388,6 +388,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); } @@ -467,8 +471,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; @@ -493,6 +497,10 @@ static void starfish_reshape (Display *dpy, Window window, void *closure, unsigned int w, unsigned int h) { + struct state *st = (struct state *) closure; + free_starfish (st->starfish); + st->starfish = 0; + st->starfish = reset_starfish (st); } static Bool @@ -514,6 +522,7 @@ starfish_free (Display *dpy, Window window, void *closure) static const char *starfish_defaults [] = { ".background: black", ".foreground: white", + "*fpsSolid: true", "*delay: 10000", "*thickness: 0", /* pixels, 0 = random */ "*rotation: -1", /* degrees, -1 = "random" */ @@ -521,6 +530,9 @@ static const char *starfish_defaults [] = { "*duration: 30", "*delay2: 5", "*mode: random", +#ifdef HAVE_MOBILE + "*ignoreRotation: True", +#endif 0 };