/* -*- 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
{(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"},
};
{
#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();
told=tnew;
- return (ris/(float)CLOCKS_PER_SEC);
+ return (0.0125 + ris/(float)CLOCKS_PER_SEC);
#else
- return 0;
+ return 0.0150;
#endif
}
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);
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);