X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=hacks%2Fglx%2Fglsnake.c;h=9ee2cb2ad67acf0484bec31f2cff1fdb8f6e9115;hp=dd533539f41e0b06c4142465aa6badb9025dd794;hb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;hpb=96a411663168b0ba5432b407a83be55f3df0c802 diff --git a/hacks/glx/glsnake.c b/hacks/glx/glsnake.c index dd533539..9ee2cb2a 100644 --- a/hacks/glx/glsnake.c +++ b/hacks/glx/glsnake.c @@ -36,7 +36,6 @@ #include #include #include -#include /* angles */ #define ZERO 0.0 @@ -175,17 +174,17 @@ static XrmOptionDescRec opts[] = { }; static argtype vars[] = { - {(caddr_t *) &explode, "explode", "Explode", DEF_EXPLODE, t_Float}, - {(caddr_t *) &angvel, "angvel", "Angular Velocity", DEF_ANGVEL, t_Float}, - {(caddr_t *) &accel, "accel", "Acceleration", DEF_ACCEL, t_Float}, - {(caddr_t *) &statictime, "statictime", "Static Time", DEF_STATICTIME, t_Int}, - {(caddr_t *) &yangvel, "yangvel", "Angular Velocity about Y axis", DEF_YANGVEL, t_Float}, - {(caddr_t *) &zangvel, "zangvel", "Angular Velocity about X axis", DEF_ZANGVEL, t_Float}, - {(caddr_t *) &interactive, "interactive", "Interactive", DEF_INTERACTIVE, t_Bool}, - {(caddr_t *) &altcolour, "altcolour", "Alternate Colour Scheme", DEF_ALTCOLOUR, t_Bool}, - {(caddr_t *) &titles, "titles", "Titles", DEF_TITLES, t_Bool}, - {(caddr_t *) &zoom, "zoom", "Zoom", DEF_ZOOM, t_Float}, - {(caddr_t *) &wireframe, "wireframe", "Wireframe", DEF_WIREFRAME, t_Bool}, + {&explode, "explode", "Explode", DEF_EXPLODE, t_Float}, + {&angvel, "angvel", "Angular Velocity", DEF_ANGVEL, t_Float}, + {&accel, "accel", "Acceleration", DEF_ACCEL, t_Float}, + {&statictime, "statictime", "Static Time", DEF_STATICTIME, t_Int}, + {&yangvel, "yangvel", "Angular Velocity about Y axis", DEF_YANGVEL, t_Float}, + {&zangvel, "zangvel", "Angular Velocity about X axis", DEF_ZANGVEL, t_Float}, + {&interactive, "interactive", "Interactive", DEF_INTERACTIVE, t_Bool}, + {&altcolour, "altcolour", "Alternate Colour Scheme", DEF_ALTCOLOUR, t_Bool}, + {&titles, "titles", "Titles", DEF_TITLES, t_Bool}, + {&zoom, "zoom", "Zoom", DEF_ZOOM, t_Float}, + {&wireframe, "wireframe", "Wireframe", DEF_WIREFRAME, t_Bool}, }; ModeSpecOpt sws_opts = {countof(opts), opts, countof(vars), vars, NULL}; @@ -1849,6 +1848,11 @@ float morph_percent(void) { /* ang_diff / rot approaches 0, we want the complement */ retval = 1.0 - (ang_diff_max / rot_max); /* protect against naan */ + +/* Apparently some systems (Solaris) don't have isinf() */ +#undef isinf +#define isinf(x) (((x) > 999999999999.9) || ((x) < -999999999999.9)) + if (isnan(retval) || isinf(retval)) retval = 1.0; } /*printf("morph_pct = %f\n", retval);*/