X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fgalaxy.c;h=385a2b3952d677c2b6cb31fe8d433e8c8e4efdc7;hb=bc7b7a8eb122206d239ec0e693676bcce31be1aa;hp=b9b2db0d6b83cd8cd4d4bc932689688f72c017b1;hpb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;p=xscreensaver diff --git a/hacks/galaxy.c b/hacks/galaxy.c index b9b2db0d..385a2b39 100644 --- a/hacks/galaxy.c +++ b/hacks/galaxy.c @@ -56,26 +56,32 @@ static const char sccsid[] = "@(#)galaxy.c 4.04 97/07/28 xlockmore"; #endif /* !STANDALONE */ static Bool tracks; +static Bool spin; #define DEF_TRACKS "True" +#define DEF_SPIN "True" static XrmOptionDescRec opts[] = { - {"-tracks", ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "on"}, - {"+tracks", ".galaxy.tracks", XrmoptionNoArg, (caddr_t) "off"} + {"-tracks", ".galaxy.tracks", XrmoptionNoArg, "on"}, + {"+tracks", ".galaxy.tracks", XrmoptionNoArg, "off"}, + {"-spin", ".galaxy.spin", XrmoptionNoArg, "on"}, + {"+spin", ".galaxy.spin", XrmoptionNoArg, "off"} }; static argtype vars[] = { - {&tracks, "tracks", "Tracks", DEF_TRACKS, t_Bool} + {&tracks, "tracks", "Tracks", DEF_TRACKS, t_Bool}, + {&spin, "spin", "Spin", DEF_SPIN, t_Bool} }; static OptionStruct desc[] = { - {"-/+tracks", "turn on/off star tracks"} + {"-/+tracks", "turn on/off star tracks"}, + {"-/+spin", "do/don't spin viewpoint"} }; -ModeSpecOpt galaxy_opts = { 2, opts, 1, vars, desc }; +ModeSpecOpt galaxy_opts = { 4, opts, 2, vars, desc }; #define FLOATRAND ((double) LRAND() / ((double) MAXRAND)) @@ -320,8 +326,10 @@ draw_galaxy(ModeInfo * mi) int i, j, k; /* more tmp */ XPoint *dummy = NULL; - gp->rot_y += 0.01; - gp->rot_x += 0.004; + if(spin){ + gp->rot_y += 0.01; + gp->rot_x += 0.004; + } cox = COSF(gp->rot_y); six = SINF(gp->rot_y);