hedgewars/uVisualGears.pas
changeset 10361 bc95b7c769a2
parent 10354 56bd029245fc
child 10362 a39e4fa3153e
equal deleted inserted replaced
10360:c243b6a8ad9a 10361:bc95b7c769a2
   115             t:= Gear^.NextGear
   115             t:= Gear^.NextGear
   116             end
   116             end
   117         end
   117         end
   118 end;
   118 end;
   119 
   119 
       
   120 function GetSprite(sprite, SDsprite: TSprite): TSprite; inline;
       
   121 begin
       
   122     if SuddenDeathDmg then
       
   123         exit(SDsprite)
       
   124     else
       
   125         exit(sprite);
       
   126 end;
       
   127 
       
   128 function GetSpriteData(sprite, SDsprite: TSprite): PSpriteData; inline;
       
   129 begin
       
   130     exit(@SpritesData[GetSprite(sprite, SDsprite)]);
       
   131 end;
       
   132 
   120 procedure DrawVisualGears(Layer: LongWord);
   133 procedure DrawVisualGears(Layer: LongWord);
   121 var Gear: PVisualGear;
   134 var Gear: PVisualGear;
   122     tinted: boolean;
   135     tinted: boolean;
   123     tmp: real;
   136     tmp: real;
   124     i: LongInt;
   137     i: LongInt;
       
   138     sprite: TSprite;
       
   139     spriteData: PSpriteData;
   125 begin
   140 begin
   126 case Layer of
   141 case Layer of
   127     // this layer is very distant in the background when stereo
   142     // this layer is very distant in the background when stereo
   128     0: begin
   143     0: begin
   129         Gear:= VisualGearLayers[0];
   144         Gear:= VisualGearLayers[0];
   130         while Gear <> nil do
   145         while Gear <> nil do
   131             begin
   146             begin
   132             if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
   147             if Gear^.Tint <> $FFFFFFFF then Tint(Gear^.Tint);
   133             case Gear^.Kind of
   148             case Gear^.Kind of
   134               vgtCloud: if SuddenDeathDmg then
   149               vgtCloud: begin
   135                              DrawTextureF(SpritesData[sprSDCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height)
   150                         spriteData:= GetSpriteData(sprCloud, sprSDCloud);
   136                          else
   151                         DrawTextureF(spriteData^.Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, spriteData^.Width, spriteData^.Height)
   137                             DrawTextureF(SpritesData[sprCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height);
   152                         end;
   138                vgtFlake: if cFlattenFlakes then
   153                vgtFlake: begin
       
   154                          sprite:= GetSprite(sprFlake, sprSDFlake);
       
   155                          if cFlattenFlakes then
   139                              begin
   156                              begin
   140                              if SuddenDeathDmg then
   157                              if vobSDVelocity = 0 then
   141                                  if vobSDVelocity = 0 then
   158                                  DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   142                                      DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
       
   143                                  else
       
   144                                      DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
       
   145                              else
   159                              else
   146                                  if vobVelocity = 0 then
   160                                  DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
   147                                      DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
       
   148                                  else
       
   149                                      DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
       
   150                              end
   161                              end
   151                          else
   162                          else
   152                              begin
   163                              begin
   153                              if SuddenDeathDmg then
   164                              if vobSDVelocity = 0 then
   154                                  if vobSDVelocity = 0 then
   165                                  DrawTextureF(SpritesData[sprite].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
   155                                      DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
       
   156                                  else
       
   157                                      DrawTextureRotatedF(SpritesData[sprSDFlake].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)
       
   158                              else
   166                              else
   159                                  if vobVelocity = 0 then
   167                                  DrawTextureRotatedF(SpritesData[sprite].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);
   160                                      DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
       
   161                                  else
       
   162                                      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)
       
   163                              end;
   168                              end;
       
   169                          end;
   164                end;
   170                end;
   165            if Gear^.Tint <> $FFFFFFFF then
   171            if Gear^.Tint <> $FFFFFFFF then
   166                untint;
   172                untint;
   167            Gear:= Gear^.NextGear
   173            Gear:= Gear^.NextGear
   168            end
   174            end
   174           begin
   180           begin
   175           //tinted:= false;
   181           //tinted:= false;
   176           if Gear^.Tint <> $FFFFFFFF then
   182           if Gear^.Tint <> $FFFFFFFF then
   177               Tint(Gear^.Tint);
   183               Tint(Gear^.Tint);
   178           case Gear^.Kind of
   184           case Gear^.Kind of
   179               vgtFlake: if SuddenDeathDmg then
   185               vgtFlake: begin
   180                              if vobSDVelocity = 0 then
   186                          sprite:= GetSprite(sprFlake, sprSDFlake);
   181                                  DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   187                          if vobSDVelocity = 0 then
   182                              else
   188                              DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   183                                  DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
       
   184                          else
   189                          else
   185                              if vobVelocity = 0 then
   190                              DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
   186                                  DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   191                         end;
   187                              else
       
   188                                  DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
       
   189               vgtSmokeTrace: if Gear^.State < 8 then
   192               vgtSmokeTrace: if Gear^.State < 8 then
   190                   DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
   193                   DrawSprite(sprSmokeTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
   191               vgtEvilTrace: if Gear^.State < 8 then
   194               vgtEvilTrace: if Gear^.State < 8 then
   192                   DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
   195                   DrawSprite(sprEvilTrace, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.State);
   193               vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF));
   196               vgtLineTrail: DrawLine(Gear^.X, Gear^.Y, Gear^.dX, Gear^.dY, 1.0, $FF, min(Gear^.Timer, $C0), min(Gear^.Timer, $80), min(Gear^.Timer, $FF));
   202                                DrawSpriteRotatedF(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, Gear^.Tag, Gear^.Angle);
   205                                DrawSpriteRotatedF(sprDust, round(Gear^.X) + WorldDx - 11, round(Gear^.Y) + WorldDy - 11, 7 - Gear^.Frame, Gear^.Tag, Gear^.Angle);
   203                   vgtFire: if (Gear^.State and gstTmpFlag) = 0 then
   206                   vgtFire: if (Gear^.State and gstTmpFlag) = 0 then
   204                                DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8)
   207                                DrawSprite(sprFlame, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy, (RealTicks shr 6 + Gear^.Frame) mod 8)
   205                            else
   208                            else
   206                                DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16);
   209                                DrawTextureF(SpritesData[sprFlame].Texture, Gear^.FrameTicks / 900, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, (RealTicks shr 7 + Gear^.Frame) mod 8, 1, 16, 16);
   207                   vgtSplash: if SuddenDeathDmg then
   210                   vgtSplash: begin
   208                                 begin
   211                              spriteData:= GetSpriteData(sprSplash, sprite);
   209                                 if Gear^.Angle <> 0 then
   212                              if Gear^.Angle <> 0 then
   210                                     begin
   213                                 DrawTextureRotatedF(spriteData^.Texture, Gear^.scale, 0, 0, round(Gear^.X + WorldDx + (((spriteData^.Height+8)*Gear^.Scale)/2) * (Gear^.Angle / abs(Gear^.Angle))), round(Gear^.Y + WorldDy), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, spriteData^.Width, spriteData^.Height, Gear^.Angle)
   211                                     DrawTextureRotatedF(SpritesData[sprSDSplash].Texture, Gear^.scale, 0, 0, round(Gear^.X + WorldDx + (((SpritesData[sprSDSplash].Height+8)*Gear^.Scale)/2) * (Gear^.Angle / abs(Gear^.Angle))), round(Gear^.Y + WorldDy), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSDSplash].Width, SpritesData[sprSDSplash].Height, Gear^.Angle);
       
   212                                     end
       
   213                                 else
       
   214                                  //DrawSprite(sprSDSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37))
       
   215                                     DrawTextureF(SpritesData[sprSDSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSDSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSDSplash].Width, SpritesData[sprSDSplash].Height);
       
   216                                 end
       
   217                              else
   214                              else
   218                                 begin
   215                                 //DrawSprite(sprite, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37))
   219                                 if Gear^.Angle <> 0 then
   216                                 DrawTextureF(spriteData^.Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((spriteData^.Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, spriteData^.Width, spriteData^.Height);
   220                                     begin
   217                              end;
   221                                     DrawTextureRotatedF(SpritesData[sprSplash].Texture, Gear^.scale, 0, 0, round(Gear^.X + WorldDx + (((SpritesData[sprSplash].Height+8)*Gear^.Scale)/2) * (Gear^.Angle / abs(Gear^.Angle))), round(Gear^.Y + WorldDy), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSplash].Width, SpritesData[sprSplash].Height, Gear^.Angle);
   218                   vgtDroplet: begin
   222                                     end
   219                               sprite:= GetSprite(sprDroplet, sprSDDroplet);
   223                                 else
   220                               DrawSprite(sprite, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);
   224                                  //DrawSprite(sprSplash, round(Gear^.X) + WorldDx - 40, round(Gear^.Y) + WorldDy - 58, 19 - (Gear^.FrameTicks div 37));
   221                               end;
   225                                     DrawTextureF(SpritesData[sprSplash].Texture, Gear^.scale, round(Gear^.X + WorldDx), round(Gear^.Y + WorldDy - ((SpritesData[sprSplash].Height+8)*Gear^.Scale)/2), 19 - (Gear^.FrameTicks div Gear^.Timer div 37), 1, SpritesData[sprSplash].Width, SpritesData[sprSplash].Height);
       
   226                                  end;
       
   227                   vgtDroplet: if SuddenDeathDmg then
       
   228                                   DrawSprite(sprSDDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame)
       
   229                               else
       
   230                                   DrawSprite(sprDroplet, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);
       
   231                   vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
   222                   vgtBubble: DrawSprite(sprBubbles, round(Gear^.X) + WorldDx - 8, round(Gear^.Y) + WorldDy - 8, Gear^.Frame);//(RealTicks div 64 + Gear^.Frame) mod 8);
   232                vgtStraightShot: begin
   223                vgtStraightShot: begin
   233                                 if Gear^.dX < 0 then
   224                                 if Gear^.dX < 0 then
   234                                     i:= -1
   225                                     i:= -1
   235                                 else
   226                                 else
   251            tinted:= false;
   242            tinted:= false;
   252            if Gear^.Tint <> $FFFFFFFF then
   243            if Gear^.Tint <> $FFFFFFFF then
   253                Tint(Gear^.Tint);
   244                Tint(Gear^.Tint);
   254            case Gear^.Kind of
   245            case Gear^.Kind of
   255 (*
   246 (*
   256               vgtFlake: if SuddenDeathDmg then
   247               vgtFlake: begin
   257                              if vobSDVelocity = 0 then
   248                         sprite:= GetSprite(sprFlake, sprSDFlake);
   258                                  DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   249                         if vobSDVelocity = 0 then
   259                              else
   250                             DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   260                                  DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
   251                         else
   261                          else
   252                             DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
   262                              if vobVelocity = 0 then
   253                         end;*)
   263                                  DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
       
   264                              else
       
   265                                  DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);*)
       
   266                vgtSpeechBubble: begin
   254                vgtSpeechBubble: begin
   267                                 if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then
   255                                 if (Gear^.Tex <> nil) and (((Gear^.State = 0) and (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Team <> CurrentTeam)) or (Gear^.State = 1)) then
   268                                     begin
   256                                     begin
   269                                     tinted:= true;
   257                                     tinted:= true;
   270                                     Tint($FF, $FF, $FF,  $66);
   258                                     Tint($FF, $FF, $FF,  $66);
   364                                  end;
   352                                  end;
   365                    vgtNote: DrawSpriteRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   353                    vgtNote: DrawSpriteRotatedF(sprNote, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy, Gear^.Frame, 1, Gear^.Angle);
   366                    vgtBulletHit: DrawSpriteRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle);
   354                    vgtBulletHit: DrawSpriteRotatedF(sprBulletHit, round(Gear^.X) + WorldDx - 0, round(Gear^.Y) + WorldDy - 0, 7 - (Gear^.FrameTicks div 50), 1, Gear^.Angle);
   367                end;
   355                end;
   368            case Gear^.Kind of
   356            case Gear^.Kind of
   369                vgtFlake: if SuddenDeathDmg then
   357                vgtFlake: begin
   370                              if vobSDVelocity = 0 then
   358                          spriteData:= GetSpriteData(sprFlake, sprSDFlake);
   371                                  DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
   359                          if vobSDVelocity = 0 then
   372                              else
   360                              DrawTextureF(spriteData^.Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
   373                                  DrawTextureRotatedF(SpritesData[sprSDFlake].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)
       
   374                          else
   361                          else
   375                              if vobVelocity = 0 then
   362                              DrawTextureRotatedF(spriteData^.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);
   376                                  DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
   363                          end;
   377                              else
       
   378                                  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);
       
   379                vgtCircle: if gear^.Angle = 1 then
   364                vgtCircle: if gear^.Angle = 1 then
   380                               begin
   365                               begin
   381                               tmp:= Gear^.State / 100;
   366                               tmp:= Gear^.State / 100;
   382                               DrawTexture(round(Gear^.X-24*tmp) + WorldDx, round(Gear^.Y-24*tmp) + WorldDy, SpritesData[sprVampiric].Texture, tmp)
   367                               DrawTexture(round(Gear^.X-24*tmp) + WorldDx, round(Gear^.Y-24*tmp) + WorldDy, SpritesData[sprVampiric].Texture, tmp)
   383                               end
   368                               end
   395         while Gear <> nil do
   380         while Gear <> nil do
   396             begin
   381             begin
   397             if Gear^.Tint <> $FFFFFFFF then
   382             if Gear^.Tint <> $FFFFFFFF then
   398                 Tint(Gear^.Tint);
   383                 Tint(Gear^.Tint);
   399             case Gear^.Kind of
   384             case Gear^.Kind of
   400                vgtCloud: if SuddenDeathDmg then
   385                vgtCloud: begin
   401                             DrawTextureF(SpritesData[sprSDCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height)
   386                          spriteData:= GetSpriteData(sprCloud, sprSDCloud);
       
   387                          DrawTextureF(spriteData^.Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, spriteData^.Width, spriteData^.Height);
       
   388                          end;
       
   389               vgtFlake: begin
       
   390                         spriteData:= GetSpriteData(sprFlake, sprSDFlake);
       
   391                         if vobSDVelocity = 0 then
       
   392                             DrawTextureF(spriteData^.Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
   402                         else
   393                         else
   403                             DrawTextureF(SpritesData[sprCloud].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprCloud].Width, SpritesData[sprCloud].Height);
   394                             DrawTextureRotatedF(spriteData^.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);
   404               vgtFlake: if SuddenDeathDmg then
   395                         end;
   405                             if vobSDVelocity = 0 then
       
   406                                 DrawTextureF(SpritesData[sprSDFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
       
   407                             else
       
   408                                 DrawTextureRotatedF(SpritesData[sprSDFlake].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)
       
   409                         else
       
   410                             if vobVelocity = 0 then
       
   411                                 DrawTextureF(SpritesData[sprFlake].Texture, Gear^.Scale, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, SpritesData[sprFlake].Width, SpritesData[sprFlake].Height)
       
   412                             else
       
   413                                 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);
       
   414             end;
   396             end;
   415             if (Gear^.Tint <> $FFFFFFFF) then
   397             if (Gear^.Tint <> $FFFFFFFF) then
   416                 untint;
   398                 untint;
   417             Gear:= Gear^.NextGear
   399             Gear:= Gear^.NextGear
   418             end
   400             end
   423         while Gear <> nil do
   405         while Gear <> nil do
   424             begin
   406             begin
   425             if Gear^.Tint <> $FFFFFFFF then
   407             if Gear^.Tint <> $FFFFFFFF then
   426                 Tint(Gear^.Tint);
   408                 Tint(Gear^.Tint);
   427             case Gear^.Kind of
   409             case Gear^.Kind of
   428                 vgtCloud: if SuddenDeathDmg then
   410                 vgtCloud: begin
   429                             DrawSprite(sprSDCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   411                           sprite:= GetSprite(sprCloud, sprSDCloud);
   430                           else
   412                           DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame);
   431                             DrawSprite(sprCloud, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame);
   413                           end;
   432               vgtFlake: if SuddenDeathDmg then
   414               vgtFlake: begin
   433                             if vobSDVelocity = 0 then
   415                         sprite:= GetSprite(sprFlake, sprSDFlake);
   434                                 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   416                         if vobSDVelocity = 0 then
   435                             else
   417                             DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   436                                 DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
   418                         else
   437                           else
   419                             DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
   438                             if vobVelocity = 0 then
   420                         end;
   439                                 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
       
   440                             else
       
   441                                 DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
       
   442                 end;
   421                 end;
   443             if (Gear^.Tint <> $FFFFFFFF) then
   422             if (Gear^.Tint <> $FFFFFFFF) then
   444                 untint;
   423                 untint;
   445             Gear:= Gear^.NextGear
   424             Gear:= Gear^.NextGear
   446             end
   425             end
   451         while Gear <> nil do
   430         while Gear <> nil do
   452             begin
   431             begin
   453             if Gear^.Tint <> $FFFFFFFF then
   432             if Gear^.Tint <> $FFFFFFFF then
   454                 Tint(Gear^.Tint);
   433                 Tint(Gear^.Tint);
   455             case Gear^.Kind of
   434             case Gear^.Kind of
   456                 vgtFlake: if SuddenDeathDmg then
   435                 vgtFlake: begin
   457                             if vobSDVelocity = 0 then
   436                           sprite:= GetSprite(sprFlake, sprSDFlake);
   458                                 DrawSprite(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   437                           if vobSDVelocity = 0 then
   459                             else
   438                               DrawSprite(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   460                                 DrawSpriteRotatedF(sprSDFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
       
   461                           else
   439                           else
   462                             if vobVelocity = 0 then
   440                               DrawSpriteRotatedF(sprite, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle)
   463                                 DrawSprite(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame)
   441                           end;
   464                             else
       
   465                                 DrawSpriteRotatedF(sprFlake, round(Gear^.X) + WorldDx, round(Gear^.Y) + WorldDy + SkyOffset, Gear^.Frame, 1, Gear^.Angle);
       
   466                 vgtNoPlaceWarn:
   442                 vgtNoPlaceWarn:
   467                             DrawTexture(round(Gear^.X) + WorldDx - round(Gear^.Tex^.w * Gear^.Scale) div 2, round(Gear^.Y) + WorldDy - round(Gear^.Tex^.h * Gear^.Scale) div 2, Gear^.Tex, Gear^.Scale);
   443                             DrawTexture(round(Gear^.X) + WorldDx - round(Gear^.Tex^.w * Gear^.Scale) div 2, round(Gear^.Y) + WorldDy - round(Gear^.Tex^.h * Gear^.Scale) div 2, Gear^.Tex, Gear^.Scale);
   468                 end;
   444                 end;
   469             if (Gear^.Tint <> $FFFFFFFF) then
   445             if (Gear^.Tint <> $FFFFFFFF) then
   470                 untint;
   446                 untint;