hedgewars/uVisualGears.pas
branchwebgl
changeset 9950 2759212a27de
parent 9521 8054d9d775fd
parent 9769 5814e0c47c99
child 10015 4feced261c68
--- a/hedgewars/uVisualGears.pas	Fri Oct 11 17:43:13 2013 +0200
+++ b/hedgewars/uVisualGears.pas	Sat Jan 04 23:55:54 2014 +0400
@@ -167,7 +167,7 @@
                              end;
                end;
            if Gear^.Tint <> $FFFFFFFF then
-               Tint($FF,$FF,$FF,$FF);
+               untint;
            Gear:= Gear^.NextGear
            end
        end;
@@ -219,10 +219,17 @@
                               else
                                   DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);
                   vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
+               vgtStraightShot: begin 
+                                if Gear^.dX < 0 then
+                                    i:= -1
+                                else
+                                    i:= 1;
+                                DrawTextureRotatedF(SpritesData[TSprite(Gear^.State)].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, i, SpritesData[TSprite(Gear^.State)].Width, SpritesData[TSprite(Gear^.State)].Height, Gear^.Angle);
+                                end;
               end;
-          //if (Gear^.Tint <> $FFFFFFFF) or tinted then Tint($FF,$FF,$FF,$FF);
+          //if (Gear^.Tint <> $FFFFFFFF) or tinted then untint;
           if (Gear^.Tint <> $FFFFFFFF) then
-              Tint($FF,$FF,$FF,$FF);
+              untint;
           Gear:= Gear^.NextGear
           end
        end;
@@ -284,7 +291,7 @@
                    vgtChunk: DrawSpriteRotatedF(sprChunk, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
                end;
            if (Gear^.Tint <> $FFFFFFFF) or tinted then
-               Tint($FF,$FF,$FF,$FF);
+               untint;
            Gear:= Gear^.NextGear
            end
        end;
@@ -368,7 +375,7 @@
                               DrawCircle(round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State, Gear^.Timer);
            end;
            if (Gear^.Tint <> $FFFFFFFF) or tinted then
-               Tint($FF,$FF,$FF,$FF);
+               untint;
            Gear:= Gear^.NextGear
            end
        end;
@@ -396,7 +403,7 @@
                                 DrawTextureRotatedF(SpritesData[sprFlake].Texture, Gear^.Scale, 0, 0, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height, Gear^.Angle);
             end;
             if (Gear^.Tint <> $FFFFFFFF) then
-                Tint($FF,$FF,$FF,$FF);
+                untint;
             Gear:= Gear^.NextGear
             end
         end;
@@ -424,7 +431,7 @@
                                 DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
                 end;
             if (Gear^.Tint <> $FFFFFFFF) then
-                Tint($FF,$FF,$FF,$FF);
+                untint;
             Gear:= Gear^.NextGear
             end
         end;
@@ -448,7 +455,7 @@
                                 DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
                 end;
             if (Gear^.Tint <> $FFFFFFFF) then
-                Tint($FF,$FF,$FF,$FF);
+                untint;
             Gear:= Gear^.NextGear
             end
         end;
@@ -487,7 +494,7 @@
 if (cReducedQuality and rqKillFlakes) <> 0 then
     exit;
 
-if hasBorder or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
+if hasBorder or (not cSnow) then
     for i:= 0 to Pred(vobCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else
@@ -515,7 +522,7 @@
         end
         else vg:= vg^.NextGear;
     end;
-if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
+if hasBorder or (not cSnow) then
     for i:= 0 to Pred(vobSDCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else