add extra semi-opaque layer of water to discolour objects in the water.
authornemo
Thu, 23 Jul 2009 18:48:41 +0000
changeset 2269 00f5704f5f39
parent 2268 053eb81e60ee
child 2270 71e67531f905
add extra semi-opaque layer of water to discolour objects in the water.
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Wed Jul 22 01:50:46 2009 +0000
+++ b/hedgewars/uWorld.pas	Thu Jul 23 18:48:41 2009 +0000
@@ -179,11 +179,16 @@
 
 procedure MoveCamera; forward;
 
-procedure DrawWater;
+procedure DrawWater(Alpha: byte);
 var VertexBuffer: array [0..3] of TVertex2f;
     r: TSDL_Rect;
     lw, lh: GLfloat;
 begin
+WaterColorArray[0].a := Alpha;
+WaterColorArray[1].a := Alpha;
+WaterColorArray[2].a := Alpha;
+WaterColorArray[3].a := Alpha;
+
 lw:= cScreenWidth / cScaleFactor;
 lh:= cScreenHeight * 2 / cScaleFactor;
 // Water
@@ -268,7 +273,7 @@
 
 DrawLand(WorldDx, WorldDy);
 
-DrawWater;
+DrawWater(255);
 
 // Attack bar
 if CurrentTeam <> nil then
@@ -296,6 +301,8 @@
 
 DrawVisualGears(1);
 
+if not cReducedQuality then DrawWater(128);
+
 // Waves
 {$WARNINGS OFF}
 //for i:= -1 to cWaterSprCount do DrawSprite(sprWater,  i * cWaveWidth  + ((WorldDx + (RealTicks shr 6) +  25) mod cWaveWidth), cWaterLine + WorldDy - cWaveHeight, 0);