Fix water rendering issues
authorunc0rr
Thu, 10 Sep 2009 15:35:34 +0000
changeset 2378 66fcb4d62a53
parent 2377 f3fab2b09e0c
child 2379 d62b1f224982
Fix water rendering issues
hedgewars/uWorld.pas
--- a/hedgewars/uWorld.pas	Thu Sep 10 15:30:11 2009 +0000
+++ b/hedgewars/uWorld.pas	Thu Sep 10 15:35:34 2009 +0000
@@ -195,10 +195,10 @@
 WaterColorArray[3].a := Alpha;
 
 lw:= cScreenWidth / cScaleFactor;
-lh:= cScreenHeight * 2 / cScaleFactor;
+lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16;
 // Water
-r.y:= WorldDy + cWaterLine + 16;
-if r.y < cScreenHeight * 2 / cScaleFactor then
+r.y:= WorldDy + cWaterLine;
+if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then
 	begin
 	if r.y < 0 then r.y:= 0;