X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=hacks%2Fglx%2Fglforestfire.c;h=0531ebace58e07da648c7edad7c7d7afd2c412b4;hb=e4fa2ac140f7bc56571373a7b7eb585fa4500e38;hp=dee6a56670c86a7027c41cc82d8a555110af54ea;hpb=a94197e76a5dea5cb60542840809d6c20d0abbf3;p=xscreensaver diff --git a/hacks/glx/glforestfire.c b/hacks/glx/glforestfire.c index dee6a566..0531ebac 100644 --- a/hacks/glx/glforestfire.c +++ b/hacks/glx/glforestfire.c @@ -1,7 +1,7 @@ /* -*- Mode: C; tab-width: 4 -*- */ /* fire --- 3D fire or rain landscape */ -#if !defined( lint ) && !defined( SABER ) +#if 0 static const char sccsid[] = "@(#)fire.c 5.02 2001/09/26 xlockmore"; #endif @@ -191,16 +191,17 @@ static XrmOptionDescRec opts[] = { {(char *) "-wander", (char *) ".fire.wander", XrmoptionNoArg, (caddr_t) "on"}, {(char *) "+wander", (char *) ".fire.wander", XrmoptionNoArg, (caddr_t) "off"}, {(char *) "-trees", (char *) ".fire.trees", XrmoptionSepArg, (caddr_t) NULL}, + {(char *) "-rain", (char *) ".fire.count", XrmoptionNoArg, (caddr_t) "0"}, }; static argtype vars[] = { - {(caddr_t *) & do_texture, (char *) "texture", (char *) "Texture", (char *) DEF_TEXTURE, t_Bool}, - {(caddr_t *) & do_fog, (char *) "fog", (char *) "Fog", (char *) DEF_FOG, t_Bool}, - {(caddr_t *) & do_shadows, (char *) "shadows", (char *) "Shadows", (char *) DEF_SHADOWS, t_Bool}, - {(caddr_t *) & do_trackmouse, (char *) "trackmouse", (char *) "TrackMouse", (char *) DEF_TRACKMOUSE, t_Bool}, - {(caddr_t *) & do_wander, (char *) "wander", (char *) "Wander", (char *) DEF_WANDER, t_Bool}, - {(caddr_t *) & num_trees, (char *) "trees", (char *) "Trees", (char *) DEF_TREES, t_Int}, + {&do_texture, "texture", "Texture", DEF_TEXTURE, t_Bool}, + {&do_fog, "fog", "Fog", DEF_FOG, t_Bool}, + {&do_shadows, "shadows", "Shadows", DEF_SHADOWS, t_Bool}, + {&do_trackmouse, "trackmouse", "TrackMouse", DEF_TRACKMOUSE, t_Bool}, + {&do_wander, "wander", "Wander", DEF_WANDER, t_Bool}, + {&num_trees, "trees", "Trees", DEF_TREES, t_Int}, }; static OptionStruct desc[] = { @@ -338,8 +339,13 @@ static float gettimerain(void) { #if 0 /* Oh yeah, *that's* portable! WTF. */ + /* + * I really thought clock() was standard ... EL + * I found this on the net: + * The clock() function conforms to ISO/IEC 9899:1990 (``ISO C89'') + * */ - static clock_t told=0; + static clock_t told= (clock_t)0; clock_t tnew,ris; tnew=clock(); @@ -348,9 +354,9 @@ static float gettimerain(void) told=tnew; - return (ris/(float)CLOCKS_PER_SEC); + return (0.0125 + ris/(float)CLOCKS_PER_SEC); #else - return 0; + return 0.0150; #endif } @@ -590,8 +596,11 @@ static void inittextures(ModeInfo * mi) glPixelStorei(GL_UNPACK_ALIGNMENT, 4); clear_gl_error(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - fs->gtexture->width, fs->gtexture->height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, fs->gtexture->data); + fs->gtexture->width, fs->gtexture->height, 0, + GL_RGBA, + /* GL_UNSIGNED_BYTE, */ + GL_UNSIGNED_INT_8_8_8_8_REV, + fs->gtexture->data); check_gl_error("texture"); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); @@ -619,8 +628,11 @@ static void inittextures(ModeInfo * mi) clear_gl_error(); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - fs->ttexture->width, fs->ttexture->height, 0, - GL_RGBA, GL_UNSIGNED_BYTE, fs->ttexture->data); + fs->ttexture->width, fs->ttexture->height, 0, + GL_RGBA, + /* GL_UNSIGNED_BYTE, */ + GL_UNSIGNED_INT_8_8_8_8_REV, + fs->ttexture->data); check_gl_error("texture"); glTexParameterf(GL_TEXTURE_2D,GL_TEXTURE_WRAP_S,GL_REPEAT);