X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fsierpinski3d.c;h=720948aacd202b831a0367e3295a19266307e555;hb=447db08c956099b3b183886729108bf5b364c4b8;hp=3a0a158b0989af4e4d58d8247cd2c31361cb6462;hpb=13dbc569cdc6e29019722c0ef9b932a925efbcad;p=xscreensaver diff --git a/hacks/glx/sierpinski3d.c b/hacks/glx/sierpinski3d.c index 3a0a158b..720948aa 100644 --- a/hacks/glx/sierpinski3d.c +++ b/hacks/glx/sierpinski3d.c @@ -1,9 +1,8 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* Sierpinski3D --- 3D sierpinski gasket */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)sierpinski3D.c 00.01 99/11/04 xlockmore"; - #endif /*- @@ -27,13 +26,6 @@ static const char sccsid[] = "@(#)sierpinski3D.c 00.01 99/11/04 xlockmore"; * random scattering of points. */ -/*- - * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock. - * otherwise caddr_t is not defined correctly - */ - -#include - #ifdef STANDALONE # define PROGCLASS "Sierpinski3D" # define HACK_INIT init_gasket @@ -52,10 +44,6 @@ static const char sccsid[] = "@(#)sierpinski3D.c 00.01 99/11/04 xlockmore"; # define DEFAULTS "*delay: 20000 \n" \ "*showFPS: False \n" \ "*wireframe: False \n" \ - "*maxDepth: " DEF_MAXDEPTH "\n" \ - "*speed: " DEF_SPEED "\n" \ - "*spin: " DEF_SPIN "\n" \ - "*wander: " DEF_WANDER "\n" \ # include "xlockmore.h" /* from the xscreensaver distribution */ #else /* !STANDALONE */ @@ -77,8 +65,8 @@ static Bool do_spin; static Bool do_wander; static XrmOptionDescRec opts[] = { - {"-depth", ".sierpinski3d.maxDepth", XrmoptionSepArg, (caddr_t) 0 }, - {"-speed", ".sierpinski3d.speed", XrmoptionSepArg, (caddr_t) 0 }, + {"-depth", ".sierpinski3d.maxDepth", XrmoptionSepArg, 0 }, + {"-speed", ".sierpinski3d.speed", XrmoptionSepArg, 0 }, { "-spin", ".spin", XrmoptionNoArg, "True" }, { "+spin", ".spin", XrmoptionNoArg, "False" }, { "-wander", ".wander", XrmoptionNoArg, "True" }, @@ -86,10 +74,10 @@ static XrmOptionDescRec opts[] = { }; static argtype vars[] = { - {(caddr_t *) &do_spin, "spin", "Spin", DEF_SPIN, t_Bool}, - {(caddr_t *) &do_wander, "wander", "Wander", DEF_WANDER, t_Bool}, - {(caddr_t *) &speed, "speed", "Speed", DEF_SPEED, t_Int}, - {(caddr_t *) &max_depth, "maxDepth", "MaxDepth", DEF_MAXDEPTH, t_Int}, + {&do_spin, "spin", "Spin", DEF_SPIN, t_Bool}, + {&do_wander, "wander", "Wander", DEF_WANDER, t_Bool}, + {&speed, "speed", "Speed", DEF_SPEED, t_Int}, + {&max_depth, "maxDepth", "MaxDepth", DEF_MAXDEPTH, t_Int}, }; @@ -466,7 +454,7 @@ gasket_handle_event (ModeInfo *mi, XEvent *event) gasketstruct *gp = &gasket[MI_SCREEN(mi)]; if (event->xany.type == ButtonPress && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { gp->button_down_p = True; gltrackball_start (gp->trackball, @@ -475,11 +463,19 @@ gasket_handle_event (ModeInfo *mi, XEvent *event) return True; } else if (event->xany.type == ButtonRelease && - event->xbutton.button & Button1) + event->xbutton.button == Button1) { gp->button_down_p = False; return True; } + else if (event->xany.type == ButtonPress && + (event->xbutton.button == Button4 || + event->xbutton.button == Button5)) + { + gltrackball_mousewheel (gp->trackball, event->xbutton.button, 10, + !!event->xbutton.state); + return True; + } else if (event->xany.type == MotionNotify && gp->button_down_p) {