http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.14.tar.gz
[xscreensaver] / hacks / glx / antspotlight.c
index e6f173a91f1d06c3242a602b777391b75807af63..a129b7994dc15cfe178dfd958f71572ccc495056 100644 (file)
@@ -84,7 +84,7 @@ static antspotlightstruct *antspotlight = (antspotlightstruct *) NULL;
 #define NUM_SCENES      2
 
 /* draw method for ant */
-Bool draw_ant(float *Material, int mono, int shadow, 
+Bool draw_ant(GLfloat *Material, int mono, int shadow, 
              float ant_step, Bool (*sphere)(float), Bool (*cone)(float)) {
   
   float cos1 = cos(ant_step);
@@ -357,6 +357,7 @@ void build_ant(void) {
   ant->direction = 0.0;
   ant->velocity = 0.02;
   ant->material = MaterialGray5;
+  ant->step = 0;
   find_goal();
 }
 
@@ -479,6 +480,8 @@ void draw_antspotlight_strip(ModeInfo *mi) {
   ant->position[0] += ant->velocity * cos(ant->direction);
   ant->position[2] += ant->velocity * sin(-ant->direction);
   ant->step += 10*ant->velocity;
+  while(ant->step > 2*Pi)
+    ant->step -= 2*Pi;
 }
 
 void reshape_antspotlight(ModeInfo * mi, int width, int height) {
@@ -625,7 +628,7 @@ void get_snapshot(ModeInfo *modeinfo) {
   if(MI_IS_WIREFRAME(modeinfo))
     return;
 
-  ximage = screen_to_ximage(modeinfo->xgwa.screen, modeinfo->window);
+  ximage = screen_to_ximage(modeinfo->xgwa.screen, modeinfo->window, NULL);
 
   qw = QW; qh = QH;
   tw = modeinfo->xgwa.width;