/* atlantis --- Shows moving 3D sea animals */
-#if !defined( lint ) && !defined( SABER )
-static const char sccsid[] = "@(#)atlantis.c 1.3 98/06/18 xlockmore";
-
+#if 0
+static const char sccsid[] = "@(#)atlantis.c 5.08 2003/04/09 xlockmore";
#endif
/* Copyright (c) E. Lassauge, 1998. */
* Thanks goes also to Brian Paul for making it possible and inexpensive
* to use OpenGL at home.
*
- * My e-mail address is lassauge@sagem.fr
+ * My e-mail address is lassauge@mail.dotcom.fr
*
* Eric Lassauge (May-13-1998)
*
static atlantisstruct *atlantis = NULL;
#include "xpm-ximage.h"
+
#include "../images/sea-texture.xpm"
+
static void
parse_image_data(ModeInfo *mi)
{
ap->sharks[i].v = 1.0;
}
- /* Random whae direction */
+ /* Random whale direction */
ap->whaledir = LRAND() & 1;
ap->dolph.x = 30000.0;
{0.4, 0.4, 0.4, 1.0};
static float lmodel_localviewer[] =
{0.0};
+ float fblue = 0.0, fgreen;
glFrontFace(GL_CCW);
InitFishs(ap);
- glClearColor(0.0, 0.39, 0.7, 0.0);
+ /* Add a little randomness */
+ fblue = ((float) (NRAND(30)) / 100.0) + 0.70;
+ fgreen = fblue * 0.56;
+ glClearColor(0.0, fgreen, fblue, 0.0);
}
void
}
+/* jwz -- this doesn't really work very well.
+
+ All I want to do is give the tank a gradient-filled background, instead
+ of just solid blue. The following was my guess as to how to do this,
+ but it kills my frame rate. I guess there's a more efficient way to do
+ this, but I don't see it...
+
+ I mean, all I want to do is dump some non-projected bytes into the color
+ buffer, then zero out the depth buffer. That *can't* be expensive, can
+ it?
+ */
static void
clear_tank (atlantisstruct * ap)
{
if (do_gradient && !ap->wire)
{
- static GLint gradient_list = -1;
- static GLint gradient_tex = -1;
+ static GLuint gradient_list = 0;
+ static GLuint gradient_tex = 0;
- if (gradient_list == -1)
+ if (gradient_list == 0)
{
unsigned char *pixels = 0;
int start = 64;
i = 0;
while (i < size)
{
- pixels[i++] = 0;
- pixels[i++] = (start + (i>>2)) * 0.56;
- pixels[i++] = (start + (i>>2));
- pixels[i++] = 255;
+ pixels[i] = 0; i++;
+ pixels[i] = (start + (i>>2)) * 0.56; i++;
+ pixels[i] = (start + (i>>2)); i++;
+ pixels[i] = 255; i++;
}
clear_gl_error();