X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fgltext.c;h=5b80d76c68b5aad9cb6183b64515b79a67044e58;hp=2ccae16165466b1b4a2916546db3772dc0b01b21;hb=723c9eeee862766a1534b2ce17b78adbfac1c3be;hpb=13dbc569cdc6e29019722c0ef9b932a925efbcad diff --git a/hacks/glx/gltext.c b/hacks/glx/gltext.c index 2ccae161..5b80d76c 100644 --- a/hacks/glx/gltext.c +++ b/hacks/glx/gltext.c @@ -92,7 +92,7 @@ static Bool do_wander; static XrmOptionDescRec opts[] = { { "-text", ".text", XrmoptionSepArg, 0 }, { "-spin", ".spin", XrmoptionSepArg, 0 }, - { "+spin", ".spin", XrmoptionNoArg, "False" }, + { "+spin", ".spin", XrmoptionNoArg, "" }, { "-wander", ".wander", XrmoptionNoArg, "True" }, { "+wander", ".wander", XrmoptionNoArg, "False" } }; @@ -269,16 +269,33 @@ init_text (ModeInfo *mi) } { + Bool spinx=False, spiny=False, spinz=False; double spin_speed = 1.0; double wander_speed = 0.05; double spin_accel = 1.0; - tp->rot = make_rotator (do_spin ? spin_speed : 0, - do_spin ? spin_speed : 0, - do_spin ? spin_speed : 0, + char *s = do_spin; + while (*s) + { + if (*s == 'x' || *s == 'X') spinx = True; + else if (*s == 'y' || *s == 'Y') spiny = True; + else if (*s == 'z' || *s == 'Z') spinz = True; + else + { + fprintf (stderr, + "%s: spin must contain only the characters X, Y, or Z (not \"%s\")\n", + progname, do_spin); + exit (1); + } + s++; + } + + tp->rot = make_rotator (spinx ? spin_speed : 0, + spiny ? spin_speed : 0, + spinz ? spin_speed : 0, spin_accel, do_wander ? wander_speed : 0, - True); + False); tp->trackball = gltrackball_init (); }