http://packetstormsecurity.org/UNIX/admin/xscreensaver-4.14.tar.gz
[xscreensaver] / hacks / glx / lavalite.c
index 631c2e22b6d3e7bb77e1927007dd4c52971e939a..743d6575542da3501392d1f21730cc6a00026f99 100644 (file)
@@ -96,6 +96,7 @@ extern XtAppContext app;
 #define DEFAULTS       "*delay:        10000       \n" \
                        "*showFPS:      False       \n" \
                        "*wireframe:    False       \n" \
+                       "*geometry:     640x640     \n" \
                        "*count:      " DEF_COUNT " \n" \
                        "*style:      " DEF_STYLE " \n" \
                        "*speed:      " DEF_SPEED " \n" \
@@ -244,8 +245,6 @@ typedef struct {
   GLuint bottle_list;
   GLuint ball_list;
 
-  Bool spin_x, spin_y, spin_z;    /* spin of the scene overall */
-
   int bottle_poly_count;          /* polygons in the bottle only */
 
 } lavalite_configuration;
@@ -559,7 +558,7 @@ draw_wing (GLfloat w, GLfloat h, GLfloat d, Bool wire)
   int polys = 0;
   int maxx = coords[0][countof(coords[0])-1][0];
   int maxy = coords[0][countof(coords[0])-1][1];
-  int x;
+  unsigned int x;
 
   for (x = 1; x < countof(coords[0]); x++)
     {
@@ -901,7 +900,7 @@ max_bottle_radius (lavalite_configuration *bp)
 static GLfloat
 bottle_radius_at (lavalite_configuration *bp, GLfloat z)
 {
-  GLfloat topz = -999, botz = -999, topr, botr;
+  GLfloat topz = -999, botz = -999, topr = 0, botr = 0;
   lamp_geometry *slice;
   GLfloat ratio;
 
@@ -1239,7 +1238,10 @@ animate_lava (ModeInfo *mi)
 
   mi->polygon_count = 0;
   {
-    double s = 1.0/bp->grid_size;
+    double s;
+    if (bp->grid_size == 0) bp->grid_size = 1;  /* first time through */
+    s = 1.0/bp->grid_size;
+
     glPushMatrix();
     glTranslatef (-0.5, -0.5, 0);
     glScalef (s, s, s);
@@ -1334,24 +1336,7 @@ init_lavalite (ModeInfo *mi)
   reshape_lavalite (mi, MI_WIDTH(mi), MI_HEIGHT(mi));
 
   {
-    char *s = do_spin;
-    while (*s)
-      {
-        if (*s == ' ' || *s == '\t') ;
-        else if (*s == 'x' || *s == 'X') bp->spin_x = 1;
-        else if (*s == 'y' || *s == 'Y') bp->spin_y = 1;
-        else if (*s == 'z' || *s == 'Z') bp->spin_z = 1;
-        else
-          {
-            fprintf (stderr,
-         "%s: spin must contain only the characters X, Y, or Z (not \"%s\")\n",
-                     progname, do_spin);
-            exit (1);
-          }
-        s++;
-      }
-
-    s = do_style;
+    char *s = do_style;
     if (!s || !*s || !strcasecmp (s, "classic")) bp->style = CLASSIC;
     else if (!strcasecmp (s, "giant"))  bp->style = GIANT;
     else if (!strcasecmp (s, "cone"))   bp->style = CONE;