X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fdeluxe.c;h=3db698c9ddbdf3ea98dca8380111c1b48488f183;hb=aa75c7476aeaa84cf3abc192b376a8b03c325213;hp=27ba04843921e9173582e17e64ca1e23bc19f203;hpb=f8cf5ac7b2f53510f80a0eaf286a25298be17bfe;p=xscreensaver diff --git a/hacks/deluxe.c b/hacks/deluxe.c index 27ba0484..3db698c9 100644 --- a/hacks/deluxe.c +++ b/hacks/deluxe.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1999-2012 Jamie Zawinski +/* xscreensaver, Copyright (c) 1999-2013 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 @@ -62,7 +62,14 @@ draw_star (struct state *st, Drawable w, struct throbber *t) XPoint points[11]; int x = t->x; int y = t->y; - int s = t->size / 0.383; /* trial and error, I forget how to derive this */ + + /* + The following constant is really: + sqrt(5 - sqrt(5)) / sqrt(25 - 11 * sqrt(5)) + + Reference: http://mathworld.wolfram.com/Pentagram.html + */ + int s = t->size * 2.6180339887498985; int s2 = t->size; double c = M_PI * 2; double o = -M_PI / 2; @@ -166,7 +173,7 @@ make_throbber (struct state *st, Drawable d, int w, int h, unsigned long pixel) if (t->speed > 0) t->speed = -t->speed; flags = GCForeground; -# ifndef HAVE_COCOA +# ifndef HAVE_JWXYZ if (st->transparent_p) { gcv.foreground = ~0L; @@ -174,7 +181,7 @@ make_throbber (struct state *st, Drawable d, int w, int h, unsigned long pixel) flags |= GCPlaneMask; } else -# endif /* !HAVE_COCOA */ +# endif /* !HAVE_JWXYZ */ { gcv.foreground = pixel; } @@ -186,7 +193,7 @@ make_throbber (struct state *st, Drawable d, int w, int h, unsigned long pixel) flags |= (GCLineWidth | GCCapStyle | GCJoinStyle); t->gc = XCreateGC (st->dpy, d, flags, &gcv); -# ifdef HAVE_COCOA +# ifdef HAVE_JWXYZ if (st->transparent_p) { /* give a non-opaque alpha to the color */ @@ -198,7 +205,7 @@ make_throbber (struct state *st, Drawable d, int w, int h, unsigned long pixel) jwxyz_XSetAlphaAllowed (st->dpy, t->gc, True); XSetForeground (st->dpy, t->gc, pixel); } -# endif /* HAVE_COCOA */ +# endif /* HAVE_JWXYZ */ switch (random() % 11) { case 0: case 1: case 2: case 3: t->draw = draw_star; break; @@ -268,7 +275,7 @@ deluxe_init (Display *dpy, Window window) st->dbeclear_p = get_boolean_resource (st->dpy, "useDBEClear", "Boolean"); #endif -# ifdef HAVE_COCOA /* Don't second-guess Quartz's double-buffering */ +# ifdef HAVE_JWXYZ /* Don't second-guess Quartz's double-buffering */ st->dbuf = False; # endif @@ -285,7 +292,7 @@ deluxe_init (Display *dpy, Window window) st->colors[0].pixel = get_pixel_resource(st->dpy, st->xgwa.colormap, "foreground", "Foreground"); } -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ else if (st->transparent_p) { st->nplanes = get_integer_resource (st->dpy, "planes", "Planes"); @@ -306,13 +313,13 @@ deluxe_init (Display *dpy, Window window) goto COLOR; } } -#endif /* !HAVE_COCOA */ +#endif /* !HAVE_JWXYZ */ else { -#ifndef HAVE_COCOA +#ifndef HAVE_JWXYZ COLOR: #endif - make_random_colormap (st->dpy, st->xgwa.visual, st->xgwa.colormap, + make_random_colormap (st->xgwa.screen, st->xgwa.visual, st->xgwa.colormap, st->colors, &st->ncolors, True, True, 0, True); if (st->ncolors < 2) goto MONO; @@ -431,6 +438,9 @@ static const char *deluxe_defaults [] = { "*useDBE: True", "*useDBEClear: True", #endif /* HAVE_DOUBLE_BUFFER_EXTENSION */ +#ifdef HAVE_MOBILE + "*ignoreRotation: True", +#endif 0 };