hedgewars/uGearsRender.pas
changeset 6999 486db9d26e4b
parent 6986 409dd3851309
child 7010 10a0a31804f3
equal deleted inserted replaced
6998:f2524a80eea2 6999:486db9d26e4b
   174                         hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen);
   174                         hwRound(Gear^.Hedgehog^.Gear^.X) + WorldDx, hwRound(Gear^.Hedgehog^.Gear^.Y) + WorldDy, roplen);
   175         end;
   175         end;
   176 
   176 
   177 
   177 
   178 if RopePoints.Count > 0 then
   178 if RopePoints.Count > 0 then
   179     DrawRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle)
   179     DrawSpriteRotated(sprRopeHook, hwRound(RopePoints.ar[0].X) + WorldDx, hwRound(RopePoints.ar[0].Y) + WorldDy, 1, RopePoints.HookAngle)
   180 else
   180 else
   181     if Gear^.Elasticity.QWordValue > 0 then
   181     if Gear^.Elasticity.QWordValue > 0 then
   182         DrawRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   182         DrawSpriteRotated(sprRopeHook, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   183 end;
   183 end;
   184 
   184 
   185 
   185 
   186 procedure DrawAltWeapon(Gear: PGear; sx, sy: LongInt);
   186 procedure DrawAltWeapon(Gear: PGear; sx, sy: LongInt);
   187 begin
   187 begin
   222         Tint($FF, $FF, $FF, $FF);
   222         Tint($FF, $FF, $FF, $FF);
   223         exit
   223         exit
   224         end
   224         end
   225     else if (Gear^.State and gstHHGone) <> 0 then
   225     else if (Gear^.State and gstHHGone) <> 0 then
   226         begin
   226         begin
   227         DrawRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0);
   227         DrawSpriteRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0);
   228         exit
   228         exit
   229         end;
   229         end;
   230 
   230 
   231     defaultPos:= true;
   231     defaultPos:= true;
   232     HatVisible:= false;
   232     HatVisible:= false;
   233 
   233 
   234 
   234 
   235     if HH^.Effects[hePoisoned] then
   235     if HH^.Effects[hePoisoned] then
   236         begin
   236         begin
   237         Tint($00, $FF, $40, $40);
   237         Tint($00, $FF, $40, $40);
   238         DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
   238         DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
   239         Tint($FF, $FF, $FF, $FF)
   239         Tint($FF, $FF, $FF, $FF)
   240         end;
   240         end;
   241 
   241 
   242     if ((Gear^.State and gstWinner) <> 0) and
   242     if ((Gear^.State and gstWinner) <> 0) and
   243     ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
   243     ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
   333             // draw crosshair
   333             // draw crosshair
   334             CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
   334             CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
   335             CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
   335             CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
   336  
   336  
   337             
   337             
   338             DrawRotatedTex(HH^.Team^.CrosshairTex,
   338             DrawTextureRotated(HH^.Team^.CrosshairTex,
   339                     12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
   339                     12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
   340                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
   340                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
   341             end;
   341             end;
   342         hx:= ox + 8 * sign;
   342         hx:= ox + 8 * sign;
   343         hy:= oy - 2;
   343         hy:= oy - 2;
   345         if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then
   345         if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then
   346         begin
   346         begin
   347             case CurAmmoGear^.Kind of
   347             case CurAmmoGear^.Kind of
   348                 gtShotgunShot: begin
   348                 gtShotgunShot: begin
   349                         if (CurAmmoGear^.State and gstAnimation <> 0) then
   349                         if (CurAmmoGear^.State and gstAnimation <> 0) then
   350                             DrawRotated(sprShotgun, hx, hy, sign, aangle)
   350                             DrawSpriteRotated(sprShotgun, hx, hy, sign, aangle)
   351                         else
   351                         else
   352                             DrawRotated(sprHandShotgun, hx, hy, sign, aangle);
   352                             DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle);
   353                     end;
   353                     end;
   354                 gtDEagleShot: DrawRotated(sprDEagle, hx, hy, sign, aangle);
   354                 gtDEagleShot: DrawSpriteRotated(sprDEagle, hx, hy, sign, aangle);
   355                 gtSniperRifleShot: begin
   355                 gtSniperRifleShot: begin
   356                         if (CurAmmoGear^.State and gstAnimation <> 0) then
   356                         if (CurAmmoGear^.State and gstAnimation <> 0) then
   357                             DrawRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle)
   357                             DrawSpriteRotatedF(sprSniperRifle, hx, hy, 1, sign, aangle)
   358                         else
   358                         else
   359                             DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle)
   359                             DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle)
   360                     end;
   360                     end;
   361                 gtBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
   361                 gtBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
   362                 gtRCPlane: begin
   362                 gtRCPlane: begin
   363                     DrawRotated(sprHandPlane, hx, hy, sign, 0);
   363                     DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
   364                     defaultPos:= false
   364                     defaultPos:= false
   365                     end;
   365                     end;
   366                 gtRope: begin
   366                 gtRope: begin
   367                     if Gear^.X < CurAmmoGear^.X then
   367                     if Gear^.X < CurAmmoGear^.X then
   368                         begin
   368                         begin
   384                             0,
   384                             0,
   385                             DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
   385                             DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + dAngle);
   386                     with HH^ do
   386                     with HH^ do
   387                         if (HatTex <> nil) then
   387                         if (HatTex <> nil) then
   388                             begin
   388                             begin
   389                             DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
   389                             DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
   390                                 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   390                                 i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   391                             if HatTex^.w > 64 then
   391                             if HatTex^.w > 64 then
   392                                 begin
   392                                 begin
   393                                 Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   393                                 Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   394                                 DrawRotatedTextureF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
   394                                 DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
   395                                     i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   395                                     i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   396                                 Tint($FF, $FF, $FF, $FF)
   396                                 Tint($FF, $FF, $FF, $FF)
   397                                 end
   397                                 end
   398                             end
   398                             end
   399                     end;
   399                     end;
   400                     DrawAltWeapon(Gear, ox, oy);
   400                     DrawAltWeapon(Gear, ox, oy);
   401                     defaultPos:= false
   401                     defaultPos:= false
   402                     end;
   402                     end;
   403                 gtBlowTorch:
   403                 gtBlowTorch:
   404                     begin
   404                     begin
   405                     DrawRotated(sprBlowTorch, hx, hy, sign, aangle);
   405                     DrawSpriteRotated(sprBlowTorch, hx, hy, sign, aangle);
   406                     DrawHedgehog(sx, sy,
   406                     DrawHedgehog(sx, sy,
   407                             sign,
   407                             sign,
   408                             3,
   408                             3,
   409                             HH^.visStepPos div 2,
   409                             HH^.visStepPos div 2,
   410                             0);
   410                             0);
   433                                 Tint($FF, $FF, $FF, $FF)
   433                                 Tint($FF, $FF, $FF, $FF)
   434                                 end
   434                                 end
   435                             end;
   435                             end;
   436                     defaultPos:= false
   436                     defaultPos:= false
   437                     end;
   437                     end;
   438                 gtShover: DrawRotated(sprHandBaseball, hx, hy, sign, aangle + 180);
   438                 gtShover: DrawSpriteRotated(sprHandBaseball, hx, hy, sign, aangle + 180);
   439                 gtFirePunch:
   439                 gtFirePunch:
   440                     begin
   440                     begin
   441                     DrawHedgehog(sx, sy,
   441                     DrawHedgehog(sx, sy,
   442                             sign,
   442                             sign,
   443                             1,
   443                             1,
   451                     dec(sy,20);
   451                     dec(sy,20);
   452                     end;
   452                     end;
   453                 gtTeleport: defaultPos:= false;
   453                 gtTeleport: defaultPos:= false;
   454                 gtWhip:
   454                 gtWhip:
   455                     begin
   455                     begin
   456                     DrawRotatedF(sprWhip,
   456                     DrawSpriteRotatedF(sprWhip,
   457                             sx,
   457                             sx,
   458                             sy,
   458                             sy,
   459                             1,
   459                             1,
   460                             sign,
   460                             sign,
   461                             0);
   461                             0);
   462                     defaultPos:= false
   462                     defaultPos:= false
   463                     end;
   463                     end;
   464                 gtHammer:
   464                 gtHammer:
   465                     begin
   465                     begin
   466                     DrawRotatedF(sprHammer,
   466                     DrawSpriteRotatedF(sprHammer,
   467                             sx,
   467                             sx,
   468                             sy,
   468                             sy,
   469                             1,
   469                             1,
   470                             sign,
   470                             sign,
   471                             0);
   471                             0);
   472                     defaultPos:= false
   472                     defaultPos:= false
   473                     end;
   473                     end;
   474                 gtResurrector:
   474                 gtResurrector:
   475                     begin
   475                     begin
   476                     DrawRotated(sprHandResurrector, sx, sy, 0, 0);
   476                     DrawSpriteRotated(sprHandResurrector, sx, sy, 0, 0);
   477                     defaultPos:= false
   477                     defaultPos:= false
   478                     end;
   478                     end;
   479                 gtKamikaze:
   479                 gtKamikaze:
   480                     begin
   480                     begin
   481                     if CurAmmoGear^.Pos = 0 then
   481                     if CurAmmoGear^.Pos = 0 then
   483                                 sign,
   483                                 sign,
   484                                 1,
   484                                 1,
   485                                 6,
   485                                 6,
   486                                 0)
   486                                 0)
   487                     else
   487                     else
   488                         DrawRotatedF(sprKamikaze,
   488                         DrawSpriteRotatedF(sprKamikaze,
   489                                 ox, oy,
   489                                 ox, oy,
   490                                 CurAmmoGear^.Pos - 1,
   490                                 CurAmmoGear^.Pos - 1,
   491                                 sign,
   491                                 sign,
   492                                 aangle);
   492                                 aangle);
   493                     defaultPos:= false
   493                     defaultPos:= false
   500                                 2,
   500                                 2,
   501                                 2,
   501                                 2,
   502                                 0)
   502                                 0)
   503                     else
   503                     else
   504                         begin
   504                         begin
   505                         DrawRotatedF(sprDress,
   505                         DrawSpriteRotatedF(sprDress,
   506                                 ox, oy,
   506                                 ox, oy,
   507                                 CurAmmoGear^.Pos,
   507                                 CurAmmoGear^.Pos,
   508                                 sign,
   508                                 sign,
   509                                 0);
   509                                 0);
   510                         DrawSprite(sprCensored, ox - 32, oy - 20, 0)
   510                         DrawSprite(sprCensored, ox - 32, oy - 20, 0)
   511                         end;
   511                         end;
   512                     defaultPos:= false
   512                     defaultPos:= false
   513                     end;
   513                     end;
   514                 gtFlamethrower:
   514                 gtFlamethrower:
   515                     begin
   515                     begin
   516                     DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   516                     DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   517                     if CurAmmoGear^.Tex <> nil then
   517                     if CurAmmoGear^.Tex <> nil then
   518                         DrawCentered(sx, sy - 40, CurAmmoGear^.Tex)
   518                         DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
   519                     end;
   519                     end;
   520                 gtLandGun:
   520                 gtLandGun:
   521                     begin DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
   521                     begin DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
   522                     if CurAmmoGear^.Tex <> nil then
   522                     if CurAmmoGear^.Tex <> nil then
   523                         DrawCentered(sx, sy - 40, CurAmmoGear^.Tex)
   523                         DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex)
   524                     end;
   524                     end;
   525             end;
   525             end;
   526 
   526 
   527             case CurAmmoGear^.Kind of
   527             case CurAmmoGear^.Kind of
   528                 gtShotgunShot,
   528                 gtShotgunShot,
   566                 begin
   566                 begin
   567                 Gear^.State:= Gear^.State and (not gstAnimation);
   567                 Gear^.State:= Gear^.State and (not gstAnimation);
   568                 end
   568                 end
   569             else
   569             else
   570                 begin
   570                 begin
   571                 DrawRotatedF(Wavez[TWave(Gear^.Tag)].Sprite,
   571                 DrawSpriteRotatedF(Wavez[TWave(Gear^.Tag)].Sprite,
   572                         sx,
   572                         sx,
   573                         sy,
   573                         sy,
   574                         Gear^.Pos,
   574                         Gear^.Pos,
   575                         sign,
   575                         sign,
   576                         0.0);
   576                         0.0);
   592                 dec(HH^.Timer)
   592                 dec(HH^.Timer)
   593                 end;
   593                 end;
   594             amt:= CurrentHedgehog^.CurAmmoType;
   594             amt:= CurrentHedgehog^.CurAmmoType;
   595             CurWeapon:= GetCurAmmoEntry(HH^);
   595             CurWeapon:= GetCurAmmoEntry(HH^);
   596             case amt of
   596             case amt of
   597                 amBazooka: DrawRotated(sprHandBazooka, hx, hy, sign, aangle);
   597                 amBazooka: DrawSpriteRotated(sprHandBazooka, hx, hy, sign, aangle);
   598                 amSnowball: DrawRotated(sprHandSnowball, hx, hy, sign, aangle);
   598                 amSnowball: DrawSpriteRotated(sprHandSnowball, hx, hy, sign, aangle);
   599                 amMortar: DrawRotated(sprHandMortar, hx, hy, sign, aangle);
   599                 amMortar: DrawSpriteRotated(sprHandMortar, hx, hy, sign, aangle);
   600                 amMolotov: DrawRotated(sprHandMolotov, hx, hy, sign, aangle);
   600                 amMolotov: DrawSpriteRotated(sprHandMolotov, hx, hy, sign, aangle);
   601                 amBallgun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
   601                 amBallgun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
   602                 amDrill: DrawRotated(sprHandDrill, hx, hy, sign, aangle);
   602                 amDrill: DrawSpriteRotated(sprHandDrill, hx, hy, sign, aangle);
   603                 amRope: DrawRotated(sprHandRope, hx, hy, sign, aangle);
   603                 amRope: DrawSpriteRotated(sprHandRope, hx, hy, sign, aangle);
   604                 amShotgun: DrawRotated(sprHandShotgun, hx, hy, sign, aangle);
   604                 amShotgun: DrawSpriteRotated(sprHandShotgun, hx, hy, sign, aangle);
   605                 amDEagle: DrawRotated(sprHandDEagle, hx, hy, sign, aangle);
   605                 amDEagle: DrawSpriteRotated(sprHandDEagle, hx, hy, sign, aangle);
   606                 amSineGun: DrawRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle);
   606                 amSineGun: DrawSpriteRotatedF(sprHandSinegun, hx, hy, 73 + (sign * LongInt(RealTicks div 73)) mod 8, sign, aangle);
   607                 
   607                 
   608                 amPortalGun:
   608                 amPortalGun:
   609                     if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
   609                     if (CurWeapon^.Timer and 2) <> 0 then // Add a new Hedgehog value instead of abusing timer?
   610                         DrawRotatedF(sprPortalGun, hx, hy, 0, sign, aangle)
   610                         DrawSpriteRotatedF(sprPortalGun, hx, hy, 0, sign, aangle)
   611                     else
   611                     else
   612                         DrawRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle);
   612                         DrawSpriteRotatedF(sprPortalGun, hx, hy, 1+CurWeapon^.Pos, sign, aangle);
   613                         
   613                         
   614                 amSniperRifle: DrawRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle);
   614                 amSniperRifle: DrawSpriteRotatedF(sprSniperRifle, hx, hy, 0, sign, aangle);
   615                 amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, sign, aangle);
   615                 amBlowTorch: DrawSpriteRotated(sprHandBlowTorch, hx, hy, sign, aangle);
   616                 amCake: DrawRotated(sprHandCake, hx, hy, sign, aangle);
   616                 amCake: DrawSpriteRotated(sprHandCake, hx, hy, sign, aangle);
   617                 amGrenade: DrawRotated(sprHandGrenade, hx, hy, sign, aangle);
   617                 amGrenade: DrawSpriteRotated(sprHandGrenade, hx, hy, sign, aangle);
   618                 amWatermelon: DrawRotated(sprHandMelon, hx, hy, sign, aangle);
   618                 amWatermelon: DrawSpriteRotated(sprHandMelon, hx, hy, sign, aangle);
   619                 amSkip: DrawRotated(sprHandSkip, hx, hy, sign, aangle);
   619                 amSkip: DrawSpriteRotated(sprHandSkip, hx, hy, sign, aangle);
   620                 amClusterBomb: DrawRotated(sprHandCluster, hx, hy, sign, aangle);
   620                 amClusterBomb: DrawSpriteRotated(sprHandCluster, hx, hy, sign, aangle);
   621                 amDynamite: DrawRotated(sprHandDynamite, hx, hy, sign, aangle);
   621                 amDynamite: DrawSpriteRotated(sprHandDynamite, hx, hy, sign, aangle);
   622                 amHellishBomb: DrawRotated(sprHandHellish, hx, hy, sign, aangle);
   622                 amHellishBomb: DrawSpriteRotated(sprHandHellish, hx, hy, sign, aangle);
   623                 amGasBomb: DrawRotated(sprHandCheese, hx, hy, sign, aangle);
   623                 amGasBomb: DrawSpriteRotated(sprHandCheese, hx, hy, sign, aangle);
   624                 amMine: DrawRotated(sprHandMine, hx, hy, sign, aangle);
   624                 amMine: DrawSpriteRotated(sprHandMine, hx, hy, sign, aangle);
   625                 amSMine: DrawRotated(sprHandSMine, hx, hy, sign, aangle);
   625                 amSMine: DrawSpriteRotated(sprHandSMine, hx, hy, sign, aangle);
   626                 amSeduction: begin
   626                 amSeduction: begin
   627                              DrawRotated(sprHandSeduction, hx, hy, sign, aangle);
   627                              DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle);
   628                              DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); 
   628                              DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA); 
   629                              //Tint($FF, $0, $0, $AA);
   629                              //Tint($FF, $0, $0, $AA);
   630                              //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10);
   630                              //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10);
   631                              //Tint($FF, $FF, $FF, $FF);
   631                              //Tint($FF, $FF, $FF, $FF);
   632                              end;
   632                              end;
   633                 amVampiric: DrawRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   633                 amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   634                 amRCPlane: begin
   634                 amRCPlane: begin
   635                     DrawRotated(sprHandPlane, hx, hy, sign, 0);
   635                     DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
   636                     defaultPos:= false
   636                     defaultPos:= false
   637                     end;
   637                     end;
   638                 amGirder: begin
   638                 amGirder: begin
   639                     DrawRotated(sprHandConstruction, hx, hy, sign, aangle);
   639                     DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle);
   640                     DrawSpriteClipped(sprGirder,
   640                     DrawSpriteClipped(sprGirder,
   641                                     ox-256,
   641                                     ox-256,
   642                                     oy-256,
   642                                     oy-256,
   643                                     LongInt(topY)+WorldDy,
   643                                     LongInt(topY)+WorldDy,
   644                                     LongInt(rightX)+WorldDx,
   644                                     LongInt(rightX)+WorldDx,
   645                                     cWaterLine+WorldDy,
   645                                     cWaterLine+WorldDy,
   646                                     LongInt(leftX)+WorldDx)
   646                                     LongInt(leftX)+WorldDx)
   647                     end;
   647                     end;
   648                 amBee: DrawRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   648                 amBee: DrawSpriteRotatedF(sprHandBee, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   649                 amFlamethrower: DrawRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   649                 amFlamethrower: DrawSpriteRotatedF(sprHandFlamethrower, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   650                 amLandGun: DrawRotated(sprHandBallgun, hx, hy, sign, aangle);
   650                 amLandGun: DrawSpriteRotated(sprHandBallgun, hx, hy, sign, aangle);
   651                 amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here
   651                 amResurrector: DrawCircle(ox, oy, 98, 4, $F5, $DB, $35, $AA); // I'd rather not like to hardcode 100 here
   652             end;
   652             end;
   653 
   653 
   654             case amt of
   654             case amt of
   655                 amAirAttack,
   655                 amAirAttack,
   656                 amMineStrike,
   656                 amMineStrike,
   657                 amDrillStrike: DrawRotated(sprHandAirAttack, sx, oy, sign, 0);
   657                 amDrillStrike: DrawSpriteRotated(sprHandAirAttack, sx, oy, sign, 0);
   658                 amPickHammer: DrawHedgehog(sx, sy,
   658                 amPickHammer: DrawHedgehog(sx, sy,
   659                             sign,
   659                             sign,
   660                             1,
   660                             1,
   661                             2,
   661                             2,
   662                             0);
   662                             0);
   663                 amTeleport: DrawRotatedF(sprTeleport, sx, sy, 0, sign, 0);
   663                 amTeleport: DrawSpriteRotatedF(sprTeleport, sx, sy, 0, sign, 0);
   664                 amKamikaze: DrawHedgehog(sx, sy,
   664                 amKamikaze: DrawHedgehog(sx, sy,
   665                             sign,
   665                             sign,
   666                             1,
   666                             1,
   667                             5,
   667                             5,
   668                             0);
   668                             0);
   669                 amWhip: DrawRotatedF(sprWhip,
   669                 amWhip: DrawSpriteRotatedF(sprWhip,
   670                             sx,
   670                             sx,
   671                             sy,
   671                             sy,
   672                             0,
   672                             0,
   673                             sign,
   673                             sign,
   674                             0);
   674                             0);
   675                 amHammer: DrawRotatedF(sprHammer,
   675                 amHammer: DrawSpriteRotatedF(sprHammer,
   676                             sx,
   676                             sx,
   677                             sy,
   677                             sy,
   678                             0,
   678                             0,
   679                             sign,
   679                             sign,
   680                             0);
   680                             0);
   698                             32,
   698                             32,
   699                             32); *)
   699                             32); *)
   700             end;
   700             end;
   701 
   701 
   702             case amt of
   702             case amt of
   703                 amBaseballBat: DrawRotated(sprHandBaseball,
   703                 amBaseballBat: DrawSpriteRotated(sprHandBaseball,
   704                         sx - 4 * sign,
   704                         sx - 4 * sign,
   705                         sy + 9, sign, aangle);
   705                         sy + 9, sign, aangle);
   706             end;
   706             end;
   707 
   707 
   708             defaultPos:= false
   708             defaultPos:= false
   734 
   734 
   735     with HH^ do
   735     with HH^ do
   736         begin
   736         begin
   737         if defaultPos then
   737         if defaultPos then
   738             begin
   738             begin
   739             DrawRotatedF(sprHHIdle,
   739             DrawSpriteRotatedF(sprHHIdle,
   740                 sx,
   740                 sx,
   741                 sy,
   741                 sy,
   742                 (RealTicks div 128 + Gear^.Pos) mod 19,
   742                 (RealTicks div 128 + Gear^.Pos) mod 19,
   743                 sign,
   743                 sign,
   744                 0);
   744                 0);
   826                                 DrawSprite(sprJetpack, sx-28, sy-28, 2);
   826                                 DrawSprite(sprJetpack, sx-28, sy-28, 2);
   827                             if (CurAmmoGear^.MsgParam and gmRight) <> 0 then
   827                             if (CurAmmoGear^.MsgParam and gmRight) <> 0 then
   828                                 DrawSprite(sprJetpack, sx-36, sy-28, 3)
   828                                 DrawSprite(sprJetpack, sx-36, sy-28, 3)
   829                             end;
   829                             end;
   830                         if CurAmmoGear^.Tex <> nil then
   830                         if CurAmmoGear^.Tex <> nil then
   831                             DrawCentered(sx, sy - 40, CurAmmoGear^.Tex);
   831                             DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex);
   832                         DrawAltWeapon(Gear, sx, sy)
   832                         DrawAltWeapon(Gear, sx, sy)
   833                         end;
   833                         end;
   834                 end;
   834                 end;
   835             end
   835             end
   836         end;
   836         end;
   845             if (cTagsMask and htTransparent) <> 0 then
   845             if (cTagsMask and htTransparent) <> 0 then
   846                 Tint($FF, $FF, $FF, $80);
   846                 Tint($FF, $FF, $FF, $80);
   847             if ((cTagsMask and htHealth) <> 0) then
   847             if ((cTagsMask and htHealth) <> 0) then
   848                 begin
   848                 begin
   849                 dec(t, HealthTagTex^.h + 2);
   849                 dec(t, HealthTagTex^.h + 2);
   850                 DrawCentered(ox, t, HealthTagTex)
   850                 DrawTextureCentered(ox, t, HealthTagTex)
   851                 end;
   851                 end;
   852             if (cTagsMask and htName) <> 0 then
   852             if (cTagsMask and htName) <> 0 then
   853                 begin
   853                 begin
   854                 dec(t, NameTagTex^.h + 2);
   854                 dec(t, NameTagTex^.h + 2);
   855                 DrawCentered(ox, t, NameTagTex)
   855                 DrawTextureCentered(ox, t, NameTagTex)
   856                 end;
   856                 end;
   857             if (cTagsMask and htTeamName) <> 0 then
   857             if (cTagsMask and htTeamName) <> 0 then
   858                 begin
   858                 begin
   859                 dec(t, Team^.NameTagTex^.h + 2);
   859                 dec(t, Team^.NameTagTex^.h + 2);
   860                 DrawCentered(ox, t, Team^.NameTagTex)
   860                 DrawTextureCentered(ox, t, Team^.NameTagTex)
   861                 end;
   861                 end;
   862             if (cTagsMask and htTransparent) <> 0 then
   862             if (cTagsMask and htTransparent) <> 0 then
   863                 Tint($FF, $FF, $FF, $FF)
   863                 Tint($FF, $FF, $FF, $FF)
   864             end;
   864             end;
   865         if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
   865         if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
   866             begin
   866             begin
   867             if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then
   867             if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then
   868                 DrawCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex);
   868                 DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex);
   869 
   869 
   870             if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
   870             if bShowFinger and ((Gear^.State and gstHHDriven) <> 0) then
   871                 DrawSprite(sprFinger, ox - 16, oy - 64,
   871                 DrawSprite(sprFinger, ox - 16, oy - 64,
   872                             GameTicks div 32 mod 16);
   872                             GameTicks div 32 mod 16);
   873 
   873 
   878         end;
   878         end;
   879 
   879 
   880     if HH^.Effects[hePoisoned] then
   880     if HH^.Effects[hePoisoned] then
   881         begin
   881         begin
   882         Tint($00, $FF, $40, $80);
   882         Tint($00, $FF, $40, $80);
   883         DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360);
   883         DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 1.5, 0, 0, sx, sy, 0, 1, 22, 22, 360 - (RealTicks shr 37) mod 360);
   884         end;
   884         end;
   885     if HH^.Effects[heResurrected] then
   885     if HH^.Effects[heResurrected] then
   886         begin
   886         begin
   887         Tint($f5, $db, $35, $20);
   887         Tint($f5, $db, $35, $20);
   888         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
   888         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
   911     aAngle: real;
   911     aAngle: real;
   912     startX, endX, startY, endY: LongInt;
   912     startX, endX, startY, endY: LongInt;
   913 begin
   913 begin
   914     if Gear^.Target.X <> NoPointX then
   914     if Gear^.Target.X <> NoPointX then
   915         if Gear^.AmmoType = amBee then
   915         if Gear^.AmmoType = amBee then
   916             DrawRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
   916             DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
   917         else
   917         else
   918             DrawRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
   918             DrawSpriteRotatedF(sprTargetP, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
   919 
   919 
   920     case Gear^.Kind of
   920     case Gear^.Kind of
   921           gtGrenade: DrawRotated(sprBomb, x, y, 0, Gear^.DirAngle);
   921           gtGrenade: DrawSpriteRotated(sprBomb, x, y, 0, Gear^.DirAngle);
   922       gtSnowball: DrawRotated(sprSnowball, x, y, 0, Gear^.DirAngle);
   922       gtSnowball: DrawSpriteRotated(sprSnowball, x, y, 0, Gear^.DirAngle);
   923        gtGasBomb: DrawRotated(sprCheese, x, y, 0, Gear^.DirAngle);
   923        gtGasBomb: DrawSpriteRotated(sprCheese, x, y, 0, Gear^.DirAngle);
   924                   
   924                   
   925        gtMolotov: if (Gear^.State and gstDrowning) = 0 then
   925        gtMolotov: if (Gear^.State and gstDrowning) = 0 then
   926                        DrawRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX))
   926                        DrawSpriteRotatedF(sprMolotov, x, y, (RealTicks div 125) mod 8, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX))
   927                   else DrawSprite(sprMolotov, x, y, 8);
   927                   else DrawSprite(sprMolotov, x, y, 8);
   928 
   928 
   929        gtRCPlane: begin
   929        gtRCPlane: begin
   930                   aangle:= Gear^.Angle * 360 / 4096;
   930                   aangle:= Gear^.Angle * 360 / 4096;
   931                   if Gear^.Tag < 0 then aangle:= 360-aangle;
   931                   if Gear^.Tag < 0 then aangle:= 360-aangle;
   932                   Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
   932                   Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
   933                   DrawRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
   933                   DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
   934                   Tint($FF, $FF, $FF, $FF);
   934                   Tint($FF, $FF, $FF, $FF);
   935                   DrawRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
   935                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
   936                   end;
   936                   end;
   937        gtBall: DrawRotatedf(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
   937        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
   938 
   938 
   939        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
   939        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
   940                  or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked?
   940                  or (Gear^.IntersectGear = nil) or (Gear^.IntersectGear^.IntersectGear <> Gear) // not linked&backlinked?
   941                  or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving?
   941                  or ((Gear^.IntersectGear^.Tag and 1) = 0) then // linked portal still moving?
   942                       DrawRotatedf(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
   942                       DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
   943                  else DrawRotatedf(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
   943                  else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
   944 
   944 
   945            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
   945            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
   946                         DrawRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
   946                         DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
   947                     else
   947                     else
   948                         DrawRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   948                         DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   949 
   949 
   950         gtHedgehog: DrawHH(Gear, x, y);
   950         gtHedgehog: DrawHH(Gear, x, y);
   951 
   951 
   952            gtShell: DrawRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   952            gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   953 
   953 
   954            gtGrave: begin
   954            gtGrave: begin
   955                     DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32);
   955                     DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 7, 1, 32, 32);
   956                     if Gear^.Health > 0 then
   956                     if Gear^.Health > 0 then
   957                         begin
   957                         begin
   960                         //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
   960                         //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
   961                         DrawSprite(sprVampiric, x - 24, y - 24, 0);
   961                         DrawSprite(sprVampiric, x - 24, y - 24, 0);
   962                         Tint($FF, $FF, $FF, $FF)
   962                         Tint($FF, $FF, $FF, $FF)
   963                         end
   963                         end
   964                     end;
   964                     end;
   965              gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   965              gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
   966       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
   966       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
   967             gtRope: DrawRope(Gear);
   967             gtRope: DrawRope(Gear);
   968             
   968             
   969             gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
   969             gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
   970                            DrawRotated(sprMineOff, x, y, 0, Gear^.DirAngle)
   970                            DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle)
   971                        else if Gear^.Health <> 0 then
   971                        else if Gear^.Health <> 0 then
   972                            DrawRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
   972                            DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
   973                        else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
   973                        else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
   974                        
   974                        
   975            gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
   975            gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
   976                            DrawRotated(sprSMineOff, x, y, 0, Gear^.DirAngle)
   976                            DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle)
   977                        else if Gear^.Health <> 0 then
   977                        else if Gear^.Health <> 0 then
   978                            DrawRotated(sprSMineOn, x, y, 0, Gear^.DirAngle)
   978                            DrawSpriteRotated(sprSMineOn, x, y, 0, Gear^.DirAngle)
   979                        else DrawRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
   979                        else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
   980                        
   980                        
   981             gtCase: if ((Gear^.Pos and posCaseAmmo) <> 0) then
   981             gtCase: if ((Gear^.Pos and posCaseAmmo) <> 0) then
   982                         begin
   982                         begin
   983                         i:= (GameTicks shr 6) mod 64;
   983                         i:= (GameTicks shr 6) mod 64;
   984                         if i > 18 then
   984                         if i > 18 then
  1009                         if i > 18 then
  1009                         if i > 18 then
  1010                             i:= 0;
  1010                             i:= 0;
  1011                         DrawSprite(sprExplosives, x - 24, y - 24, i)
  1011                         DrawSprite(sprExplosives, x - 24, y - 24, i)
  1012                         end
  1012                         end
  1013                     else if Gear^.State and gsttmpFlag = 0 then
  1013                     else if Gear^.State and gsttmpFlag = 0 then
  1014                         DrawRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle)
  1014                         DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 0, 0, Gear^.DirAngle)
  1015                     else
  1015                     else
  1016                         DrawRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle);
  1016                         DrawSpriteRotatedF(sprExplosivesRoll, x, y + 4, 1, 0, Gear^.DirAngle);
  1017                     end;
  1017                     end;
  1018         gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1);
  1018         gtDynamite: DrawSprite(sprDynamite, x - 16, y - 25, Gear^.Tag and 1, Gear^.Tag shr 1);
  1019      gtClusterBomb: DrawRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
  1019      gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
  1020          gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0);
  1020          gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0);
  1021            gtFlame: if Gear^.Tag and 1 = 0 then
  1021            gtFlame: if Gear^.Tag and 1 = 0 then
  1022                          DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16)
  1022                          DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16)
  1023                     else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16);
  1023                     else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16);
  1024        gtParachute: begin
  1024        gtParachute: begin
  1025                     DrawSprite(sprParachute, x - 24, y - 48, 0);
  1025                     DrawSprite(sprParachute, x - 24, y - 48, 0);
  1026                     DrawAltWeapon(Gear, x + 1, y - 3)
  1026                     DrawAltWeapon(Gear, x + 1, y - 3)
  1027                     end;
  1027                     end;
  1028        gtAirAttack: begin
  1028        gtAirAttack: begin
  1029                     Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1029                     Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1030                     DrawRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
  1030                     DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
  1031                     Tint($FF, $FF, $FF, $FF);
  1031                     Tint($FF, $FF, $FF, $FF);
  1032                     DrawRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
  1032                     DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
  1033                     end;
  1033                     end;
  1034          gtAirBomb: DrawRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1034          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1035         gtTeleport: begin
  1035         gtTeleport: begin
  1036                     HHGear:= Gear^.Hedgehog^.Gear;
  1036                     HHGear:= Gear^.Hedgehog^.Gear;
  1037                     if not Gear^.Hedgehog^.Unplaced then
  1037                     if not Gear^.Hedgehog^.Unplaced then
  1038                         DrawRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
  1038                         DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
  1039                     DrawRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
  1039                     DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0);
  1040                     end;
  1040                     end;
  1041         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12);
  1041         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12);
  1042           gtTarget: begin
  1042           gtTarget: begin
  1043                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
  1043                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
  1044                     DrawSprite(sprTarget, x - 16, y - 16, 0);
  1044                     DrawSprite(sprTarget, x - 16, y - 16, 0);
  1045                     Tint($FF, $FF, $FF, $FF);
  1045                     Tint($FF, $FF, $FF, $FF);
  1046                     end;
  1046                     end;
  1047           gtMortar: DrawRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1047           gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1048           gtCake: if Gear^.Pos = 6 then
  1048           gtCake: if Gear^.Pos = 6 then
  1049                      DrawRotatedf(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
  1049                      DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
  1050                   else
  1050                   else
  1051                      DrawRotatedf(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90);
  1051                      DrawSpriteRotatedF(sprCakeDown, x, y, 5 - Gear^.Pos, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90);
  1052        gtSeduction: if Gear^.Pos >= 14 then
  1052        gtSeduction: if Gear^.Pos >= 14 then
  1053            DrawSprite(sprSeduction, x - 16, y - 16, 0);
  1053            DrawSprite(sprSeduction, x - 16, y - 16, 0);
  1054            
  1054            
  1055       gtWatermelon: DrawRotatedf(sprWatermelon, x, y, 0, 0, Gear^.DirAngle);
  1055       gtWatermelon: DrawSpriteRotatedF(sprWatermelon, x, y, 0, 0, Gear^.DirAngle);
  1056       gtMelonPiece: DrawRotatedf(sprWatermelon, x, y, 1, 0, Gear^.DirAngle);
  1056       gtMelonPiece: DrawSpriteRotatedF(sprWatermelon, x, y, 1, 0, Gear^.DirAngle);
  1057      gtHellishBomb: DrawRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle);
  1057      gtHellishBomb: DrawSpriteRotated(sprHellishBomb, x, y, 0, Gear^.DirAngle);
  1058            gtBirdy: begin
  1058            gtBirdy: begin
  1059                     if Gear^.State and gstAnimation = gstAnimation then
  1059                     if Gear^.State and gstAnimation = gstAnimation then
  1060                         begin
  1060                         begin
  1061                         if Gear^.State and gstTmpFlag = 0 then // Appearing
  1061                         if Gear^.State and gstTmpFlag = 0 then // Appearing
  1062                             begin
  1062                             begin
  1087                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 7)) mod 2, Gear^.Tag, 75, 75)
  1087                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 7)) mod 2, Gear^.Tag, 75, 75)
  1088                         else
  1088                         else
  1089                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1089                             DrawTextureF(SpritesData[sprBirdy].Texture, 1, x, y, ((Gear^.Pos shr 6) or (RealTicks shr 8)) mod 2, Gear^.Tag, 75, 75);
  1090                         end;
  1090                         end;
  1091                     end;
  1091                     end;
  1092              gtEgg: DrawRotatedTextureF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle);
  1092              gtEgg: DrawTextureRotatedF(SpritesData[sprEgg].Texture, 1, 0, 0, x, y, 0, 1, 16, 16, Gear^.DirAngle);
  1093            gtPiano: begin
  1093            gtPiano: begin
  1094                     if (Gear^.State and gstDrowning) = 0 then
  1094                     if (Gear^.State and gstDrowning) = 0 then
  1095                         begin
  1095                         begin
  1096                         Tint($FF, $FF, $FF, $10);
  1096                         Tint($FF, $FF, $FF, $10);
  1097                         for i:= 8 downto 1 do
  1097                         for i:= 8 downto 1 do
  1105                         Tint($C0, $C0, $00, Gear^.Timer div 8)
  1105                         Tint($C0, $C0, $00, Gear^.Timer div 8)
  1106                     else if Gear^.Timer > 3980 then
  1106                     else if Gear^.Timer > 3980 then
  1107                         Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
  1107                         Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
  1108                     else
  1108                     else
  1109                         Tint($C0, $C0, $00, $C0);
  1109                         Tint($C0, $C0, $00, $C0);
  1110                     DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
  1110                     DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
  1111                     Tint($FF, $FF, $FF, $FF)
  1111                     Tint($FF, $FF, $FF, $FF)
  1112                     end;
  1112                     end;
  1113      gtResurrector: begin
  1113      gtResurrector: begin
  1114                     DrawRotated(sprCross, x, y, 0, 0);
  1114                     DrawSpriteRotated(sprCross, x, y, 0, 0);
  1115                     Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
  1115                     Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
  1116                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
  1116                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
  1117                     Tint($FF, $FF, $FF, $FF);
  1117                     Tint($FF, $FF, $FF, $FF);
  1118                     end;
  1118                     end;
  1119       gtNapalmBomb: DrawRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1119       gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1120            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
  1120            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
  1121                         begin
  1121                         begin
  1122                         Tint((ExplosionBorderColor shr RShift) and $FF, 
  1122                         Tint((ExplosionBorderColor shr RShift) and $FF, 
  1123                              (ExplosionBorderColor shr GShift) and $FF, 
  1123                              (ExplosionBorderColor shr GShift) and $FF, 
  1124                              (ExplosionBorderColor shr BShift) and $FF, 
  1124                              (ExplosionBorderColor shr BShift) and $FF, 
  1125                              $FF);
  1125                              $FF);
  1126                         // Needs a nicer white texture to tint
  1126                         // Needs a nicer white texture to tint
  1127                         DrawRotatedTextureF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
  1127                         DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
  1128                         //DrawRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
  1128                         //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
  1129                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
  1129                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
  1130                         Tint($FF, $FF, $FF, $FF);
  1130                         Tint($FF, $FF, $FF, $FF);
  1131                         end
  1131                         end
  1132                     else //if not isInLag then
  1132                     else //if not isInLag then
  1133                         begin
  1133                         begin
  1138                         if Gear^.FlightTime > 0 then
  1138                         if Gear^.FlightTime > 0 then
  1139                             Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime));
  1139                             Tint($FF, $FF, $FF, $FF-min(255,Gear^.FlightTime));
  1140                         if vobVelocity = 0 then
  1140                         if vobVelocity = 0 then
  1141                             DrawSprite(sprFlake, x, y, Gear^.Timer)
  1141                             DrawSprite(sprFlake, x, y, Gear^.Timer)
  1142                         else
  1142                         else
  1143                             DrawRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
  1143                             DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
  1144 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer)
  1144 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer)
  1145 //DrawRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
  1145 //DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
  1146                         if Gear^.FlightTime > 0 then
  1146                         if Gear^.FlightTime > 0 then
  1147                             Tint($FF, $FF, $FF, $FF);
  1147                             Tint($FF, $FF, $FF, $FF);
  1148                         end;
  1148                         end;
  1149        gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
  1149        gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
  1150           gtTardis: if Gear^.Pos <> 4 then
  1150           gtTardis: if Gear^.Pos <> 4 then
  1169                         end;
  1169                         end;
  1170 
  1170 
  1171 
  1171 
  1172          end;
  1172          end;
  1173       if Gear^.RenderTimer and (Gear^.Tex <> nil) then
  1173       if Gear^.RenderTimer and (Gear^.Tex <> nil) then
  1174           DrawCentered(x + 8, y + 8, Gear^.Tex);
  1174           DrawTextureCentered(x + 8, y + 8, Gear^.Tex);
  1175 end;
  1175 end;
  1176 
  1176 
  1177 end.
  1177 end.