X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fepicycle.c;h=4f94a907e4abc6aaa0c0513e8499d43f179b406e;hb=6afd6db0ae9396cd7ff897ade597cd5483f49b0e;hp=c77cee690f0433fd1fb39dbef6d7a04755062509;hpb=49f5b54f312fe4ac2e9bc47581a72451bd0e8439;p=xscreensaver diff --git a/hacks/epicycle.c b/hacks/epicycle.c index c77cee69..4f94a907 100644 --- a/hacks/epicycle.c +++ b/hacks/epicycle.c @@ -49,9 +49,10 @@ static const char *epicycle_defaults [] = { ".background: black", ".foreground: white", + "*fpsSolid: true", "*colors: 100", "*color0: red", - "*delay: 1000", + "*delay: 20000", "*holdtime: 2", "*lineWidth: 4", "*minCircles: 2", @@ -64,6 +65,9 @@ static const char *epicycle_defaults [] = { "*divisorPoisson: 0.4", "*sizeFactorMin: 1.05", "*sizeFactorMax: 2.05", +#ifdef USE_IPHONE + "*ignoreRotation: True", +#endif 0 }; @@ -224,14 +228,6 @@ random_divisor(struct state *st) } -static void -oom(struct state *st) -{ - fprintf(stderr, "Failed to allocate memory!\n"); - exit(-1); -} - - /* Construct a circle or die. */ static Circle * @@ -310,8 +306,7 @@ static Body * new_body(struct state *st) { Body *p = malloc(sizeof(Body)); - if (NULL == p) - oom(st); + if (!p) abort(); p->epicycles = new_circle_chain(st); p->current_color = 0; /* ?? start them all on different colors? */ p->next = NULL; @@ -409,7 +404,7 @@ colour_init(struct state *st, XWindowAttributes *pxgwa) */ if (st->colors) { - free_colors(st->dpy, st->cmap, st->colors, st->ncolors); + free_colors(pxgwa->screen, st->cmap, st->colors, st->ncolors); st->colors = 0; st->ncolors = 0; } @@ -427,10 +422,10 @@ colour_init(struct state *st, XWindowAttributes *pxgwa) if (!mono_p) { st->colors = (XColor *) malloc(sizeof(*st->colors) * (st->ncolors+1)); - if (!st->colors) - oom(st); + if (!st->colors) abort(); - make_smooth_colormap (st->dpy, pxgwa->visual, st->cmap, st->colors, &st->ncolors, + make_smooth_colormap (pxgwa->screen, pxgwa->visual, st->cmap, + st->colors, &st->ncolors, True, /* allocate */ False, /* not writable */ True); /* verbose (complain about failure) */ @@ -769,7 +764,7 @@ static Bool epicycle_event (Display *dpy, Window window, void *closure, XEvent *e) { struct state *st = (struct state *) closure; - if (e->type == ButtonPress) + if (screenhack_event_helper (dpy, window, e)) { st->restart = 1; return True;