Skip drawing some stuff if water is opaque. Affects simulation.
--- a/hedgewars/GSHandlers.inc Mon Feb 22 00:47:50 2010 +0000
+++ b/hedgewars/GSHandlers.inc Mon Feb 22 00:53:04 2010 +0000
@@ -126,9 +126,9 @@
AllInactive:= false;
Gear^.Y:= Gear^.Y + cDrownSpeed;
Gear^.X:= Gear^.X + Gear^.dX * cDrownSpeed;
-if hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater then DeleteGear(Gear);
+if (cWaterOpacity > $FE) or (hwRound(Gear^.Y) > Gear^.Radius + cWaterLine + cVisibleWater) then DeleteGear(Gear);
// Create some bubbles (0.5% might be better but causes too few bubbles sometimes)
-if (GameTicks and $1F) = 0 then
+if (cWaterOpacity < $FF) and ((GameTicks and $1F) = 0) then
if (Gear^.Kind = gtHedgehog) and (Random(4) = 0) then
AddVisualGear(hwRound(Gear^.X) - Gear^.Radius, hwRound(Gear^.Y) - Gear^.Radius, vgtBubble)
else if Random(12) = 0 then
--- a/hedgewars/uGears.pas Mon Feb 22 00:47:50 2010 +0000
+++ b/hedgewars/uGears.pas Mon Feb 22 00:53:04 2010 +0000
@@ -457,7 +457,8 @@
begin
t:= max(Gear^.Damage, Gear^.Health);
Gear^.Damage:= t;
- AddGear(hwRound(Gear^.X), min(hwRound(Gear^.Y),cWaterLine+cVisibleWater+32), gtHealthTag, t, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
+ if cWaterOpacity < $FF then
+ AddGear(hwRound(Gear^.X), min(hwRound(Gear^.Y),cWaterLine+cVisibleWater+32), gtHealthTag, t, _0, _0, 0)^.Hedgehog:= Gear^.Hedgehog;
uStats.HedgehogDamaged(Gear)
end;