ftp://ftp.krokus.ru/pub/OpenBSD/distfiles/xscreensaver-4.06.tar.gz
[xscreensaver] / hacks / glx / atlantis.c
index 9f07ddbd17b9a5c0df25b241417a2e106cdee280..d37998954977d62cd442aab77f5209bf329ea5c8 100644 (file)
@@ -174,8 +174,10 @@ ModStruct   atlantis_description =
 static atlantisstruct *atlantis = NULL;
 
 #include "xpm-ximage.h"
+
 #include "../images/sea-texture.xpm"
 
+
 static void
 parse_image_data(ModeInfo *mi)
 {
@@ -340,6 +342,17 @@ reshape_atlantis(ModeInfo * mi, int width, int height)
 }
 
 
+/* 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)
 {
@@ -362,10 +375,10 @@ clear_tank (atlantisstruct * ap)
           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();