Allow vgtSmoke to scale. Scale it down 50% for mines, so smoke doesn't seem so oversized
authornemo
Fri, 26 Aug 2011 22:15:09 -0400
changeset 5690 f6e0c5bd8020
parent 5689 48ef34701751
child 5691 54b12cc39e95
Allow vgtSmoke to scale. Scale it down 50% for mines, so smoke doesn't seem so oversized
hedgewars/GSHandlers.inc
hedgewars/uVisualGears.pas
--- a/hedgewars/GSHandlers.inc	Fri Aug 26 21:49:10 2011 -0400
+++ b/hedgewars/GSHandlers.inc	Fri Aug 26 22:15:09 2011 -0400
@@ -1713,6 +1713,7 @@
 
 ////////////////////////////////////////////////////////////////////////////////
 procedure doStepMine(Gear: PGear);
+var vg: PVisualGear;
 begin
     if (Gear^.State and gstMoving) <> 0 then
     begin
@@ -1742,7 +1743,10 @@
                  inc(Gear^.Damage, hwRound(Gear^.dX * -_70));
         
         if (Gear^.Damage > random(30)) and ((GameTicks and $FF) = 0) then
-            AddVisualGear(hwRound(Gear^.X) - 4  + Random(8), hwRound(Gear^.Y) - 4 - Random(4), vgtSmoke);
+            begin
+            vg:= AddVisualGear(hwRound(Gear^.X) - 4  + Random(8), hwRound(Gear^.Y) - 4 - Random(4), vgtSmoke);
+            if vg <> nil then vg^.Scale:= 0.5
+            end;
 
         if (Gear^.Damage > 35) then
             begin
@@ -1774,8 +1778,8 @@
                     end
                 else
                     begin
-                    AddVisualGear(hwRound(Gear^.X) - 4  + Random(8), hwRound(Gear^.Y) - 4 - Random(4),
-                    vgtSmoke);
+                    vg:= AddVisualGear(hwRound(Gear^.X) - 4  + Random(8), hwRound(Gear^.Y) - 4 - Random(4), vgtSmoke);
+                    if vg <> nil then vg^.Scale:= 0.5;
                     PlaySound(sndVaporize);
                     Gear^.Health := 0;
                     Gear^.Damage := 0;
--- a/hedgewars/uVisualGears.pas	Fri Aug 26 21:49:10 2011 -0400
+++ b/hedgewars/uVisualGears.pas	Fri Aug 26 22:15:09 2011 -0400
@@ -229,6 +229,7 @@
                 end;
   vgtSmokeWhite,
   vgtSmoke: begin
+                Scale:= 1.0;
                 dx:= 0.0002 * (random(45) + 10);
                 dy:= 0.0002 * (random(45) + 10);
                 if random(2) = 0 then dx := -dx;
@@ -535,7 +536,7 @@
           end;
           if (cReducedQuality and rqAntiBoom) = 0 then
               case Gear^.Kind of
-                  vgtSmoke: DrawSprite(sprSmoke, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame);
+                  vgtSmoke: DrawTextureF(SpritesData[sprSmoke].Texture, Gear^.scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, 7 - Gear^.Frame, 0, SpritesData[sprSmoke].Width, SpritesData[sprSmoke].Height);
                   vgtSmokeWhite: DrawSprite(sprSmokeWhite, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame);
                   vgtDust: if Gear^.State = 1 then
                                DrawSprite(sprSnowDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame)