Spread the droplets around more so it looks less square (looked especially bad with piano). Slow down large splashes a bit for dramatic purposes, also taking low-g into account. Small splashes you can't really tell anyway.
authornemo
Mon, 09 Jul 2012 23:28:02 -0400
changeset 7372 fcc002658832
parent 7370 d50b874e7ee8
child 7374 514138949c76
child 7375 16ae2e1c9005
child 7383 8f675ab05802
Spread the droplets around more so it looks less square (looked especially bad with piano). Slow down large splashes a bit for dramatic purposes, also taking low-g into account. Small splashes you can't really tell anyway.
hedgewars/uGearsUtils.pas
hedgewars/uVisualGears.pas
--- a/hedgewars/uGearsUtils.pas	Sun Jul 08 23:14:24 2012 +0400
+++ b/hedgewars/uGearsUtils.pas	Mon Jul 09 23:28:02 2012 -0400
@@ -403,34 +403,41 @@
             begin
             splash:= AddVisualGear(X, cWaterLine, vgtSplash);
             if splash <> nil then 
+                with splash^ do
                 begin
-                splash^.Scale:= hwFloat2Float(Gear^.Density / _3 * Gear^.dY);
-                if splash^.Scale > 1 then splash^.Scale:= power(splash^.Scale,0.3333)
-                else splash^.Scale:= splash^.Scale + ((1-splash^.Scale) / 2);
+                Scale:= hwFloat2Float(Gear^.Density / _3 * Gear^.dY);
+                if Scale > 1 then Scale:= power(Scale,0.3333)
+                else Scale:= Scale + ((1-Scale) / 2);
+                if Scale > 1 then Timer:= round(max(Scale,3))
+                else Timer:= 1;
+                // Low Gravity
+                Timer:=round(0.0005/cGravityf);
+                FrameTicks:= FrameTicks*Timer;
                 end;
 
             maxDrops := (hwRound(Gear^.Density) * 3) div 2 + round(vdX * hwRound(Gear^.Density) * 6) + round(vdY * hwRound(Gear^.Density) * 6);
             for i:= max(maxDrops div 3, min(32, Random(maxDrops))) downto 0 do
                 begin
-                particle := AddVisualGear(X - 3 + Random(6), cWaterLine, vgtDroplet);
+                particle := AddVisualGear(X - 3 + Random(7), cWaterLine, vgtDroplet);
                 if particle <> nil then
-                    begin
-                    particle^.dX := particle^.dX - vdX / 10;
-                    particle^.dY := particle^.dY - vdY / 5;
-                    if splash <> nil then
+                    with particle^ do
                         begin
-                        if splash^.Scale > 1 then 
+                        dX := dX - vdX / 10;
+                        dY := dY - vdY / 5;
+                        if splash <> nil then
                             begin
-                            particle^.dX:= particle^.dX * power(splash^.Scale,0.3333); // tone down the droplet height further
-                            particle^.dY:= particle^.dY * power(splash^.Scale, 0.3333)
-                            end
-                        else 
-                            begin
-                            particle^.dX:= particle^.dX * splash^.Scale;
-                            particle^.dY:= particle^.dY * splash^.Scale
+                            if splash^.Scale > 1 then 
+                                begin
+                                dX:= dX * power(splash^.Scale,0.3333); // tone down the droplet height further
+                                dY:= dY * power(splash^.Scale, 0.3333)
+                                end
+                            else 
+                                begin
+                                dX:= dX * splash^.Scale;
+                                dY:= dY * splash^.Scale
+                                end
                             end
                         end
-                    end
                 end
             end;
         if isSubmersible and (CurAmmoGear^.Pos = 0) then
--- a/hedgewars/uVisualGears.pas	Sun Jul 08 23:14:24 2012 +0400
+++ b/hedgewars/uVisualGears.pas	Mon Jul 09 23:28:02 2012 -0400
@@ -298,10 +298,8 @@
                 end;
     vgtDroplet:
                 begin
-                dx:= 0.001 * (random(75) + 15);
-                dy:= -0.001 * (random(80) + 120);
-                if random(2) = 0 then
-                    dx := -dx;
+                dx:= 0.001 * (random(180) - 90);
+                dy:= -0.001 * (random(160) + 40);
                 FrameTicks:= 250 + random(1751);
                 Frame:= random(3)
                 end;
@@ -651,10 +649,10 @@
                                DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16);
                   vgtSplash: if SuddenDeathDmg then
                                  //DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37))
-                                 DrawTextureF(SpritesData[sprSDSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSDSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div 37), 1, SpritesData[sprSDSplash].Width, SpritesData[sprSDSplash].Height)
+                                 DrawTextureF(SpritesData[sprSDSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSDSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSDSplash].Width, SpritesData[sprSDSplash].Height)
                              else
                                  //DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37));
-                                 DrawTextureF(SpritesData[sprSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div 37), 1, SpritesData[sprSplash].Width, SpritesData[sprSplash].Height);
+                                 DrawTextureF(SpritesData[sprSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSplash].Width, SpritesData[sprSplash].Height);
                   vgtDroplet: if SuddenDeathDmg then
                                   DrawSprite(sprSDDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame)
                               else