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