X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fgalaxy.c;h=385a2b3952d677c2b6cb31fe8d433e8c8e4efdc7;hb=bc7b7a8eb122206d239ec0e693676bcce31be1aa;hp=08d870bb6e2a3b312dc748041ecab880465aa73e;hpb=14627f4038ada5d11456f3770090f3c39740d70f;p=xscreensaver diff --git a/hacks/galaxy.c b/hacks/galaxy.c index 08d870bb..385a2b39 100644 --- a/hacks/galaxy.c +++ b/hacks/galaxy.c @@ -1,7 +1,7 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* galaxy --- spinning galaxies */ /* #include*/ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)galaxy.c 4.04 97/07/28 xlockmore"; #endif @@ -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[] = { - {(caddr_t *) & 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);