X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fdeluxe.c;h=06cfe1b9dc7373b3c4d1b15e4331930f8f6fcc04;hb=4ade52359b6eba3621566dac79793a33aa4c915f;hp=09c59b37c8dab3e24a103095f4d566cde581a444;hpb=c1b9b55ad8d59dc05ef55e316aebf5863e7dfa56;p=xscreensaver diff --git a/hacks/deluxe.c b/hacks/deluxe.c index 09c59b37..06cfe1b9 100644 --- a/hacks/deluxe.c +++ b/hacks/deluxe.c @@ -1,4 +1,4 @@ -/* xscreensaver, Copyright (c) 1999-2008 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; @@ -156,7 +163,7 @@ make_throbber (struct state *st, Drawable d, int w, int h, unsigned long pixel) struct throbber *t = (struct throbber *) malloc (sizeof (*t)); t->x = w / 2; t->y = h / 2; - t->max_size = w; + t->max_size = (w > h ? w : h); t->speed = get_integer_resource (st->dpy, "speed", "Speed"); t->fuse = 1 + (random() % 4); t->thickness = get_integer_resource (st->dpy, "thickness", "Thickness"); @@ -312,7 +319,7 @@ deluxe_init (Display *dpy, Window window) #ifndef HAVE_COCOA 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 USE_IPHONE + "*ignoreRotation: True", +#endif 0 };