fix two very ambiguous for loops that calculate camerawidth and
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 16 Apr 2013 03:16:17 +0000 (03:16 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 16 Apr 2013 03:16:17 +0000 (03:16 +0000)
cameraheight

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11934 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index ffb11d7..1ab7aaa 100644 (file)
@@ -5784,10 +5784,10 @@ static void R_Water_StartFrame(void)
        }
        else
        {
-               for (texturewidth   = 1;texturewidth   < waterwidth ;texturewidth   *= 2);
-               for (textureheight  = 1;textureheight  < waterheight;textureheight  *= 2);
-               for (camerawidth    = 1;camerawidth   <= waterwidth; camerawidth    *= 2); camerawidth  /= 2;
-               for (cameraheight   = 1;cameraheight  <= waterheight;cameraheight   *= 2); cameraheight /= 2;
+               for (texturewidth   = 1;texturewidth     <  waterwidth ;texturewidth   *= 2);
+               for (textureheight  = 1;textureheight    <  waterheight;textureheight  *= 2);
+               for (camerawidth    = 1;camerawidth  * 2 <= waterwidth ;camerawidth    *= 2);
+               for (cameraheight   = 1;cameraheight * 2 <= waterheight;cameraheight   *= 2);
        }
 
        // allocate textures as needed