use bubbles underwater
authornemo
Tue, 14 May 2013 09:25:53 -0400
changeset 8993 839ce342474a
parent 8992 5b0be812dcdb
child 8994 b8c234a84b16
use bubbles underwater
hedgewars/GSHandlers.inc
--- a/hedgewars/GSHandlers.inc	Tue May 14 08:57:30 2013 -0400
+++ b/hedgewars/GSHandlers.inc	Tue May 14 09:25:53 2013 -0400
@@ -498,7 +498,11 @@
     or (Gear^.Kind = gtBall) then
         CalcRotationDirAngle(Gear)
     else if (GameTicks and $1F) = 0 then
-        AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
+        begin
+        if hwRound(Gear^.Y) > cWaterLine then
+             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
+        else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
+        end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -515,7 +519,11 @@
         exit
         end;
     if (GameTicks and $3F) = 0 then
-        AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
+        begin
+        if hwRound(Gear^.Y) > cWaterLine then
+             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
+        else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
+        end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2438,7 +2446,11 @@
         end;
 
     if (GameTicks and $3F) = 0 then
-        AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
+        begin
+        if hwRound(Gear^.Y) > cWaterLine then
+             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
+        else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
+        end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -2938,7 +2950,11 @@
     doStepFallingGear(Gear);
 
     if (GameTicks and $3F) = 0 then
-        AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
+        begin
+        if hwRound(Gear^.Y) > cWaterLine then
+             AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtBubble)
+        else AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace)
+        end;
 
     if ((Gear^.State and gstCollision) <> 0) then
         begin