hedgewars/uGearsRender.pas
changeset 5179 8d64dcb566ea
parent 5145 120f4271f197
child 5197 9fa96377a69c
equal deleted inserted replaced
5178:f3cc6119f1fe 5179:8d64dcb566ea
   574                 amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
   574                 amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
   575                 amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle);
   575                 amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle);
   576                 amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle);
   576                 amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle);
   577                 amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle);
   577                 amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle);
   578                 amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle);
   578                 amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle);
   579                 amSineGun: DrawRotatedF(sprHandSinegun, hx, hy, 73+(sign * (RealTicks div 73)) mod 8, sign, aangle);
   579                 amSineGun: DrawRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle);
   580                 amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
   580                 amPortalGun: if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
   581                                 DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle)
   581                                 DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle)
   582                         else
   582                         else
   583                                 DrawRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle);
   583                                 DrawRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle);
   584                 amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle);
   584                 amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle);
   994                             if Gear^.Tag < 0 then
   994                             if Gear^.Tag < 0 then
   995                                 startX:= max(LAND_WIDTH + 1024, endX + 2048)
   995                                 startX:= max(LAND_WIDTH + 1024, endX + 2048)
   996                             else
   996                             else
   997                                 startX:= max(-LAND_WIDTH - 1024, endX - 2048);
   997                                 startX:= max(-LAND_WIDTH - 1024, endX - 2048);
   998                             startY:= endY - 256;
   998                             startY:= endY - 256;
   999                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1)), startY + WorldDy + round((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
   999                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * (-power(2, -10 * LongInt(Gear^.Timer)/2000) + 1))), startY + WorldDy + LongInt(round((endY - startY) * sqrt(1 - power((LongInt(Gear^.Timer)/2000)-1, 2)))), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1000                             end
  1000                             end
  1001                         else // Disappearing
  1001                         else // Disappearing
  1002                             begin
  1002                             begin
  1003                             startX:= x - WorldDx;
  1003                             startX:= x - WorldDx;
  1004                             startY:= y - WorldDy;
  1004                             startY:= y - WorldDy;
  1005                             if Gear^.Tag > 0 then
  1005                             if Gear^.Tag > 0 then
  1006                                 endX:= max(LAND_WIDTH + 1024, startX + 2048)
  1006                                 endX:= max(LAND_WIDTH + 1024, startX + 2048)
  1007                             else
  1007                             else
  1008                                 endX:= max(-LAND_WIDTH - 1024, startX - 2048);
  1008                                 endX:= max(-LAND_WIDTH - 1024, startX - 2048);
  1009                             endY:= startY + 256;
  1009                             endY:= startY + 256;
  1010                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + round((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY)) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1010                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, startX + WorldDx + LongInt(round((endX - startX) * power(2, 10 * (LongInt(Gear^.Timer)/2000 - 1)))) + hwRound(Gear^.dX * Gear^.Timer), startY + WorldDy + LongInt(round((endY - startY) * cos(LongInt(Gear^.Timer)/2000 * (Pi/2)) - (endY - startY))) + hwRound(Gear^.dY * Gear^.Timer), ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1011                             end;
  1011                             end;
  1012                         end
  1012                         end
  1013                     else
  1013                     else
  1014                         DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1014                         DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1015                     end;
  1015                     end;