- Bee sprites for target and HH hand
authorpalewolf
Sat, 27 Mar 2010 11:59:03 +0000
changeset 3104 6cdc45b3b8a6
parent 3103 7a12eef0245d
child 3105 a919d0757938
- Bee sprites for target and HH hand
hedgewars/GSHandlers.inc
hedgewars/uGears.pas
hedgewars/uWorld.pas
share/hedgewars/Data/Graphics/Hedgehog/amBee.png
share/hedgewars/Data/Graphics/TargetBee.png
--- a/hedgewars/GSHandlers.inc	Sat Mar 27 11:53:37 2010 +0000
+++ b/hedgewars/GSHandlers.inc	Sat Mar 27 11:59:03 2010 +0000
@@ -1924,7 +1924,6 @@
         playSound(sndWarp)
         end;
 TargetPoint.X:= NoPointX;
-
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
--- a/hedgewars/uGears.pas	Sat Mar 27 11:53:37 2010 +0000
+++ b/hedgewars/uGears.pas	Sat Mar 27 11:59:03 2010 +0000
@@ -1249,6 +1249,7 @@
                                   cWaterLine+WorldDy,
                                   LongInt(leftX)+WorldDx)
                 end;
+            amBee: DrawRotated(sprHandBee, hx, hy, hwSign(Gear^.dX), aangle);
         end;
 
         case amt of
--- a/hedgewars/uWorld.pas	Sat Mar 27 11:53:37 2010 +0000
+++ b/hedgewars/uWorld.pas	Sat Mar 27 11:59:03 2010 +0000
@@ -288,7 +288,7 @@
 
 procedure MoveCamera; forward;
 
-procedure DrawWater(Alpha: byte);
+procedure DrawWater(Alpha: byte; OffsetY: LongInt);
 var VertexBuffer: array [0..3] of TVertex2f;
     r: TSDL_Rect;
     lw, lh: GLfloat;
@@ -301,7 +301,7 @@
 lw:= cScreenWidth / cScaleFactor;
 lh:= trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 + 16;
 // Water
-r.y:= WorldDy + cWaterLine;
+r.y:= OffsetY + WorldDy + cWaterLine;
 if WorldDy < trunc(cScreenHeight / cScaleFactor) + cScreenHeight div 2 - cWaterLine then
     begin
     if r.y < 0 then r.y:= 0;
@@ -468,15 +468,16 @@
 
 // Waves
 offsetY:= 10 * min(0, -145 - screenBottom);
-DrawWaves( 1,  0 + WorldDx div 32, - cWaveHeight + offsetY div 35, 0.25);
+DrawWater(255, offsetY div 35);
+DrawWaves( 1,  0 - WorldDx div 32, - cWaveHeight + offsetY div 35, 0.25);
 DrawWaves( -1,  25 + WorldDx div 25, - cWaveHeight + offsetY div 38, 0.19);
-DrawWaves( 1,  75 + WorldDx div 19, - cWaveHeight + offsetY div 45, 0.14);
+DrawWaves( 1,  75 - WorldDx div 19, - cWaveHeight + offsetY div 45, 0.14);
 DrawWaves(-1, 100 + WorldDx div 14, - cWaveHeight + offsetY div 70, 0.09);
 
 
 DrawLand(WorldDx, WorldDy);
 
-DrawWater(255);
+DrawWater(255, 0);
 
 // Attack bar
 if CurrentTeam <> nil then
@@ -506,19 +507,30 @@
 
 DrawVisualGears(2);
 
-DrawWater(cWaterOpacity);
+DrawWater(cWaterOpacity, 0);
 
 // Waves
-DrawWaves( 1, 25 + WorldDx div 9, - cWaveHeight, 0.05);
-DrawWaves(-1, 50 + WorldDx div 6, 1 - cWaveHeight - offsetY div 40, 0.03);
-DrawWaves( 1, 75 + WorldDx div 4, 3- cWaveHeight - offsetY div 20, 0.01);
-DrawWaves( -1, 25 + WorldDx div 3, 5 - cWaveHeight - offsetY div 10, 0);
+DrawWaves( 1, 25 - WorldDx div 9, - cWaveHeight, 0.05);
+//DrawWater(cWaterOpacity, - offsetY div 40);
+DrawWaves(-1, 50 + WorldDx div 6, - cWaveHeight - offsetY div 40, 0.03);
+DrawWater(cWaterOpacity, - offsetY div 20);
+DrawWaves( 1, 75 - WorldDx div 4, - cWaveHeight - offsetY div 20, 0.01);
+DrawWater(cWaterOpacity, - offsetY div 10);
+DrawWaves( -1, 25 + WorldDx div 3, - cWaveHeight - offsetY div 10, 0);
 
 
 {$WARNINGS OFF}
 // Target
-if TargetPoint.X <> NoPointX then
-    DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
+    begin
+    with PHedgehog(CurrentHedgehog)^ do
+        begin
+        if (Ammo^[CurSlot, CurAmmo].AmmoType = amBee) then
+            DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
+        else
+            DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
+        end;
+    end;
 {$WARNINGS ON}
 
 {$IFDEF IPHONEOS}
Binary file share/hedgewars/Data/Graphics/Hedgehog/amBee.png has changed
Binary file share/hedgewars/Data/Graphics/TargetBee.png has changed