X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglplanet.c;h=91b4ad0ccc7087dc1a6d567f46b41270813204c7;hp=e81199956d56fe22f00d4b17329297fd1ea059e0;hb=2d04c4f22466851aedb6ed0f2919d148f726b889;hpb=bc7b7a8eb122206d239ec0e693676bcce31be1aa diff --git a/hacks/glx/glplanet.c b/hacks/glx/glplanet.c index e8119995..91b4ad0c 100644 --- a/hacks/glx/glplanet.c +++ b/hacks/glx/glplanet.c @@ -183,25 +183,6 @@ typedef struct { static planetstruct *planets = NULL; -static inline void -normalize(GLfloat v[3]) -{ - GLfloat d = (GLfloat) sqrt((double) (v[0] * v[0] + - v[1] * v[1] + - v[2] * v[2])); - if (d != 0) - { - v[0] /= d; - v[1] /= d; - v[2] /= d; - } - else - { - v[0] = v[1] = v[2] = 0; - } -} - - /* Set up and enable texturing on our object */ static void setup_xpm_texture (ModeInfo *mi, char **xpm_data) @@ -467,7 +448,7 @@ planet_handle_event (ModeInfo *mi, XEvent *event) planetstruct *gp = &planets[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, @@ -476,11 +457,19 @@ planet_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) {