Fix bad water flow animation
authorKoBeWi <kobewi4e@gmail.com>
Sat, 08 Apr 2017 17:21:22 +0200
changeset 12195 4d818abdc00f
parent 12194 31184d9b9bfc
child 12196 5c6e7fd5af29
Fix bad water flow animation
hedgewars/uLandObjects.pas
hedgewars/uRender.pas
hedgewars/uVariables.pas
--- a/hedgewars/uLandObjects.pas	Sat Apr 08 17:17:28 2017 +0200
+++ b/hedgewars/uLandObjects.pas	Sat Apr 08 17:21:22 2017 +0200
@@ -777,7 +777,7 @@
         i:= Pos(',', s);
         watFrameTicks:= StrToInt(Trim(Copy(s, 1, Pred(i))));
         Delete(s, 1, i);
-        watMove:= StrToInt(Trim(Copy(s, 1, Pred(i))));
+        watMove:= StrToInt(Trim(s));
         end
     else if key = 'sd-water-animation' then
         begin
@@ -787,7 +787,7 @@
         i:= Pos(',', s);
         watSDFrameTicks:= StrToInt(Trim(Copy(s, 1, Pred(i))));
         Delete(s, 1, i);
-        watSDMove:= StrToInt(Trim(Copy(s, 1, Pred(i))));
+        watSDMove:= StrToInt(Trim(s));
         end
     else if key = 'flakes' then
         begin
--- a/hedgewars/uRender.pas	Sat Apr 08 17:17:28 2017 +0200
+++ b/hedgewars/uRender.pas	Sat Apr 08 17:21:22 2017 +0200
@@ -1873,7 +1873,7 @@
 else
 	frame:= 0;
 
-TextureBuffer[3].X:= shift + ((LongInt(RealTicks shr (16 - waterSpeed)) * Dir + dX) mod spriteWidth) / (spriteWidth - 1);
+TextureBuffer[3].X:= shift + ((LongInt((RealTicks * waterSpeed) shr 6) * Dir + dX) mod spriteWidth) / (spriteWidth - 1);
 TextureBuffer[3].Y:= frame * realHeight;
 TextureBuffer[5].X:= TextureBuffer[3].X + nWaves;
 TextureBuffer[5].Y:= frame * realHeight;
--- a/hedgewars/uVariables.pas	Sat Apr 08 17:17:28 2017 +0200
+++ b/hedgewars/uVariables.pas	Sat Apr 08 17:21:22 2017 +0200
@@ -2766,7 +2766,7 @@
     vobFallSpeed:= 100;
     watFrames:= 1;
     watFrameTicks:= 0;
-    watMove:= 10;
+    watMove:= 1;
 
     vobSDFrameTicks:= 0;
     vobSDFramesCount:= 4;
@@ -2775,7 +2775,7 @@
     vobSDFallSpeed:= 250;
     watSDFrames:= 1;
     watSDFrameTicks:= 0;
-    watSDMove:= 10;
+    watSDMove:= 1;
 
 {$IFDEF MOBILE}
     cMinScreenWidth  := min(cScreenWidth, 480);