hedgewars/uGearsRender.pas
changeset 7288 5d0704f23a2a
parent 7188 580cd247511e
parent 7276 e570bc0df33c
child 7304 8b3575750cd2
equal deleted inserted replaced
7188:580cd247511e 7288:5d0704f23a2a
   944                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
   944                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
   945                   end;
   945                   end;
   946        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
   946        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
   947 
   947 
   948        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
   948        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
   949                  or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked?
   949                  or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked?
   950                  or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving?
   950                  or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving?
   951                       DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
   951                       DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
   952                  else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
   952                  else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
   953 
   953 
   954            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
   954            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
   955                         DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
   955                         DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
   986                        else if Gear^.Health <> 0 then
   986                        else if Gear^.Health <> 0 then
   987                            DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle)
   987                            DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle)
   988                        else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
   988                        else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
   989                        
   989                        
   990             gtCase: begin
   990             gtCase: begin
   991                     if Gear^.Timer < 255 then Tint($FF, $FF, $FF, Gear^.Timer);
   991                     if Gear^.Timer > 1000 then
   992                     if ((Gear^.Pos and posCaseAmmo) <> 0) then
       
   993                         begin
   992                         begin
   994                         i:= (GameTicks shr 6) mod 64;
   993                         if ((Gear^.Pos and posCaseAmmo) <> 0) then
   995                         if i > 18 then
   994                             begin
   996                             i:= 0;
   995                             i:= (GameTicks shr 6) mod 64;
   997                         DrawSprite(sprCase, x - 24, y - 24, i);
   996                             if i > 18 then
       
   997                                 i:= 0;
       
   998                             DrawSprite(sprCase, x - 24, y - 24, i);
       
   999                             end
       
  1000                         else if ((Gear^.Pos and posCaseHealth) <> 0) then
       
  1001                             begin
       
  1002                             i:= ((GameTicks shr 6) + 38) mod 64;
       
  1003                             if i > 13 then
       
  1004                                 i:= 0;
       
  1005                             DrawSprite(sprFAid, x - 24, y - 24, i);
       
  1006                             end
       
  1007                         else if ((Gear^.Pos and posCaseUtility) <> 0) then
       
  1008                             begin
       
  1009                             i:= (GameTicks shr 6) mod 70;
       
  1010                             if i > 23 then
       
  1011                                 i:= 0;
       
  1012                             i:= i mod 12;
       
  1013                             DrawSprite(sprUtility, x - 24, y - 24, i);
       
  1014                             end;
       
  1015                         end;
       
  1016                     if Gear^.Timer <= 1833 then
       
  1017                         begin
       
  1018                         DrawTextureRotatedF(SpritesData[sprPortal].texture, min(abs(1.25 - (Gear^.Timer mod 1333) / 400), 1.25), 0, 0,
       
  1019                                             Gear^.Angle+WorldDx, Gear^.Power+WorldDy-16, 4+Gear^.Tag, 1, 32, 32, 270);
   998                         end
  1020                         end
   999                     else if ((Gear^.Pos and posCaseHealth) <> 0) then
       
  1000                         begin
       
  1001                         i:= ((GameTicks shr 6) + 38) mod 64;
       
  1002                         if i > 13 then
       
  1003                             i:= 0;
       
  1004                         DrawSprite(sprFAid, x - 24, y - 24, i);
       
  1005                         end
       
  1006                     else if ((Gear^.Pos and posCaseUtility) <> 0) then
       
  1007                         begin
       
  1008                         i:= (GameTicks shr 6) mod 70;
       
  1009                         if i > 23 then
       
  1010                             i:= 0;
       
  1011                         i:= i mod 12;
       
  1012                         DrawSprite(sprUtility, x - 24, y - 24, i);
       
  1013                         end;
       
  1014                     if Gear^.Timer < 255 then Tint($FF, $FF, $FF, $FF);
       
  1015                     end;
  1021                     end;
  1016       gtExplosives: begin
  1022       gtExplosives: begin
  1017                     if ((Gear^.State and gstDrowning) <> 0) then
  1023                     if ((Gear^.State and gstDrowning) <> 0) then
  1018                         DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0)
  1024                         DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0)
  1019                     else if Gear^.State and gstAnimation = 0 then
  1025                     else if Gear^.State and gstAnimation = 0 then