ftp://ftp.linux.ncsu.edu/mirror/ftp.redhat.com/pub/redhat/linux/enterprise/4/en/os...
[xscreensaver] / hacks / glx / superquadrics.c
index 8e2a76365199584fba03a75432c95c12e53b7962..a566589cd3a2fba8539b4208e70cc5117192b01f 100644 (file)
@@ -1,9 +1,8 @@
 /* -*- Mode: C; tab-width: 4 -*- */
 /* superquadrics --- 3D mathematical shapes */
 
-#if !defined( lint ) && !defined( SABER )
+#if 0
 static const char sccsid[] = "@(#)superquadrics.c      4.07 97/11/24 xlockmore";
-
 #endif
 
 /*-
@@ -71,21 +70,15 @@ static const char sccsid[] = "@(#)superquadrics.c   4.07 97/11/24 xlockmore";
  * Ed Mackey
  */
 
-/*-
- * due to a Bug/feature in VMS X11/Intrinsic.h has to be placed before xlock.
- * otherwise caddr_t is not defined correctly
- */
-
-#include <X11/Intrinsic.h>
-
 #ifdef STANDALONE
 # define PROGCLASS                                     "Superquadrics"
 # define HACK_INIT                                     init_superquadrics
 # define HACK_DRAW                                     draw_superquadrics
 # define superquadrics_opts                    xlockmore_opts
-# define DEFAULTS      "*delay:                100     \n"                     \
+# define DEFAULTS      "*delay:                40000   \n"                     \
                                        "*count:                25      \n"                     \
                                        "*cycles:               40      \n"                     \
+                                       "*showFPS:      False   \n"                     \
                                        "*wireframe:    False   \n"
 # include "xlockmore.h"                                /* from the xscreensaver distribution */
 #else  /* !STANDALONE */
@@ -107,11 +100,11 @@ static float spinspeed;
 
 static XrmOptionDescRec opts[] =
 {
-  {"-spinspeed", ".superquadrics.spinspeed", XrmoptionSepArg, (caddr_t) NULL}
+  {"-spinspeed", ".superquadrics.spinspeed", XrmoptionSepArg, 0}
 };
 static argtype vars[] =
 {
-  {(caddr_t *) & spinspeed, "spinspeed", "Spinspeed", DEF_SPINSPEED, t_Float}
+  {&spinspeed, "spinspeed", "Spinspeed", DEF_SPINSPEED, t_Float}
 };
 static OptionStruct desc[] =
 {
@@ -119,13 +112,13 @@ static OptionStruct desc[] =
 };
 
 ModeSpecOpt superquadrics_opts =
-{1, opts, 1, vars, desc};
+{sizeof opts / sizeof opts[0], opts, sizeof vars / sizeof vars[0], vars, desc};
 
 #ifdef USE_MODULES
 ModStruct   superquadrics_description =
 {"superquadrics", "init_superquadrics", "draw_superquadrics", "release_superquadrics",
  "refresh_superquadrics", "init_superquadrics", NULL, &superquadrics_opts,
- 1000, 25, 40, 1, 1.0, "",
+ 1000, 25, 40, 1, 4, 1.0, "",
  "Shows 3D mathematical shapes", 0, NULL};
 
 #endif
@@ -722,13 +715,13 @@ init_superquadrics(ModeInfo * mi)
                        return;
        }
        sp = &superquadrics[screen];
-       sp->mono = (MI_WIN_IS_MONO(mi) ? 1 : 0);
+       sp->mono = (MI_IS_MONO(mi) ? 1 : 0);
 
        if ((sp->glx_context = init_GL(mi)) != NULL) {
 
-               InitSuperquadrics(MI_WIN_IS_WIREFRAME(mi), 0,
-                           MI_BATCHCOUNT(mi), MI_CYCLES(mi), spinspeed, sp);
-               ReshapeSuperquadrics(MI_WIN_WIDTH(mi), MI_WIN_HEIGHT(mi));
+               InitSuperquadrics(MI_IS_WIREFRAME(mi), 0,
+                                 MI_COUNT(mi), MI_CYCLES(mi), spinspeed, sp);
+               ReshapeSuperquadrics(MI_WIDTH(mi), MI_HEIGHT(mi));
 
                DisplaySuperquadrics(sp);
                glFinish();
@@ -752,6 +745,7 @@ draw_superquadrics(ModeInfo * mi)
 
        NextSuperquadricDisplay(sp);
 
+    if (mi->fps_p) do_fps (mi);
        glFinish();
        glXSwapBuffers(display, window);
 }