hedgewars/uGearsRender.pas
branchios-develop
changeset 13413 ba39a1d396c0
parent 13405 4c813650fe17
child 13572 a71e6856ffab
equal deleted inserted replaced
13411:6e8b807bda4b 13413:ba39a1d396c0
   277         exit;
   277         exit;
   278     if (HH^.CurAmmoType = amKnife) and (HH = CurrentHedgehog) then
   278     if (HH^.CurAmmoType = amKnife) and (HH = CurrentHedgehog) then
   279          curhat:= ChefHatTexture
   279          curhat:= ChefHatTexture
   280     else curhat:= HH^.HatTex;
   280     else curhat:= HH^.HatTex;
   281     m:= 1;
   281     m:= 1;
   282     if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then
   282     if ((Gear^.State and gstHHHJump) <> 0) and (HH^.Effects[heArtillery] = 0) then
   283         m:= -1;
   283         m:= -1;
   284     sx:= ox + 1; // this offset is very common
   284     sx:= ox + 1; // this offset is very common
   285     sy:= oy - 3;
   285     sy:= oy - 3;
   286     sign:= hwSign(Gear^.dX);
   286     sign:= hwSign(Gear^.dX);
   287 
   287 
   488                         with HH^ do
   488                         with HH^ do
   489                             if (curhat <> nil) then
   489                             if (curhat <> nil) then
   490                                 begin
   490                                 begin
   491                                 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
   491                                 DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 0, i, 32, 32,
   492                                     i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   492                                     i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   493                                 if curhat^.w > 64 then
   493                                 if (curhat^.w > 64) or ((curhat^.w = 64) and (curhat^.h = 32)) then
   494                                     begin
   494                                     begin
       
   495                                     if ((curhat^.w = 64) and (curhat^.h = 32)) then
       
   496                                         tx := 1
       
   497                                     else
       
   498                                         tx := 32;
   495                                     Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   499                                     Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   496                                     DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
   500                                     DrawTextureRotatedF(curhat, 1.0, -1.0, -6.0, ox, oy, tx, i, 32, 32,
   497                                         i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   501                                         i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   498                                     untint
   502                                     untint
   499                                     end
   503                                     end
   500                                 end
   504                                 end
   501                     end;
   505                     end;
   519                                 sy - 5,
   523                                 sy - 5,
   520                                 0,
   524                                 0,
   521                                 sign,
   525                                 sign,
   522                                 32,
   526                                 32,
   523                                 32);
   527                                 32);
   524                             if curhat^.w > 64 then
   528                             if (curhat^.w > 64) or ((curhat^.w = 64) and (curhat^.h = 32)) then
   525                                 begin
   529                                 begin
       
   530                                 if ((curhat^.w = 64) and (curhat^.h = 32)) then
       
   531                                     tx := 1
       
   532                                 else
       
   533                                     tx := 32;
   526                                 Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   534                                 Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   527                                 DrawTextureF(curhat,
   535                                 DrawTextureF(curhat,
   528                                     1,
   536                                     1,
   529                                     sx,
   537                                     sx,
   530                                     sy - 5,
   538                                     sy - 5,
   531                                     32,
   539                                     tx,
   532                                     sign,
   540                                     sign,
   533                                     32,
   541                                     32,
   534                                     32);
   542                                     32);
   535                                 untint
   543                                 untint
   536                                 end
   544                                 end
   606                         DrawSpriteRotatedF(sprDress,
   614                         DrawSpriteRotatedF(sprDress,
   607                                 ox, oy,
   615                                 ox, oy,
   608                                 CurAmmoGear^.Pos,
   616                                 CurAmmoGear^.Pos,
   609                                 sign,
   617                                 sign,
   610                                 0);
   618                                 0);
   611                         DrawSprite(sprCensored, ox - 32, oy - 20, 0)
   619                         // sprCensored contains English text, so only show it for English locales
       
   620                         // TODO: Make text translatable. But how?
       
   621                         if Copy(cLocale, 1, 2) = 'en' then
       
   622                             DrawSprite(sprCensored, ox - 32, oy - 20, 0);
   612                         end;
   623                         end;
   613                     defaultPos:= false
   624                     defaultPos:= false
   614                     end;
   625                     end;
   615                 gtFlamethrower:
   626                 gtFlamethrower:
   616                     begin
   627                     begin
   637                     begin
   648                     begin
   638                     DrawHedgehog(sx, sy, sign, 0, 4, 0);
   649                     DrawHedgehog(sx, sy, sign, 0, 4, 0);
   639                     defaultPos:= false;
   650                     defaultPos:= false;
   640                     HatVisible:= true
   651                     HatVisible:= true
   641                     end;
   652                     end;
   642                 gtShover:
   653                 gtShover, gtMinigun:
   643                     begin
   654                     begin
   644                     DrawHedgehog(sx, sy, sign, 0, 5, 0);
   655                     DrawHedgehog(sx, sy, sign, 0, 5, 0);
   645                     defaultPos:= false;
   656                     defaultPos:= false;
   646                     HatVisible:= true
   657                     HatVisible:= true
   647                     end
   658                     end
   820                             sx,
   831                             sx,
   821                             sy,
   832                             sy,
   822                             0,
   833                             0,
   823                             sign,
   834                             sign,
   824                             0);
   835                             0);
   825                 amBaseballBat:
   836                 amBaseballBat, amMinigun:
   826                     begin
   837                     begin
   827                     HatVisible:= true;
   838                     HatVisible:= true;
   828                     DrawHedgehog(sx, sy,
   839                     DrawHedgehog(sx, sy,
   829                             sign,
   840                             sign,
   830                             0,
   841                             0,
   848                             sy - 5,
   859                             sy - 5,
   849                             0,
   860                             0,
   850                             sign,
   861                             sign,
   851                             32,
   862                             32,
   852                             32); *)
   863                             32); *)
   853             end;
       
   854 
       
   855             case amt of
       
   856                 amBaseballBat: DrawSpritePivotedF(sprHandBaseball,
       
   857                         sx + 9 * sign,
       
   858                         sy + 2, 0, sign, -8, 1, aangle);
       
   859             end;
   864             end;
   860 
   865 
   861             defaultPos:= false
   866             defaultPos:= false
   862         end;
   867         end;
   863 
   868 
  1023                         32);
  1028                         32);
  1024                     untint
  1029                     untint
  1025                     end
  1030                     end
  1026                 end
  1031                 end
  1027         end;
  1032         end;
       
  1033 
  1028     if (Gear^.State and gstHHDriven) <> 0 then
  1034     if (Gear^.State and gstHHDriven) <> 0 then
  1029         begin
  1035         begin
  1030     (*    if (CurAmmoGear = nil) then
  1036     (*    if (CurAmmoGear = nil) then
  1031             begin
  1037             begin
  1032             amt:= CurrentHedgehog^.CurAmmoType;
  1038             amt:= CurrentHedgehog^.CurAmmoType;
  1034                 amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0);
  1040                 amJetpack: DrawSprite(sprJetpack, sx-32, sy-32, 0);
  1035                 end
  1041                 end
  1036             end; *)
  1042             end; *)
  1037         if (CurAmmoGear = nil) then
  1043         if (CurAmmoGear = nil) then
  1038             begin
  1044             begin
  1039             if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0)
  1045                 if ((Gear^.State and (gstAttacked or gstAnimation or gstHHJumping)) = 0)
  1040             and (Gear^.Message and (gmLeft or gmRight) = 0) then
  1046                 and (Gear^.Message and (gmLeft or gmRight) = 0) then
  1041             begin
  1047                 begin
  1042                 amt:= CurrentHedgehog^.CurAmmoType;
  1048                 amt:= CurrentHedgehog^.CurAmmoType;
  1043                 case amt of
  1049                     case amt of
  1044                     amBaseballBat: DrawSpritePivotedF(sprHandBaseball,
  1050                         amBaseballBat: DrawSpritePivotedF(sprHandBaseball,
  1045                         sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle);
  1051                             sx + 9 * sign, sy + 2, 0, sign, -8, 1, aangle);
       
  1052                         amMinigun: DrawSpritePivotedF(sprMinigun,
       
  1053                             sx + 20 * sign, sy + 4, 0, sign, -18, -2, aangle);
       
  1054                     end;
  1046                 end;
  1055                 end;
  1047             end;
       
  1048             end
  1056             end
  1049         else
  1057         else
  1050             begin
  1058             begin
  1051             aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
  1059             aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
  1052             case CurAmmoGear^.Kind of
  1060             case CurAmmoGear^.Kind of
  1063                             end;
  1071                             end;
  1064                         if CurAmmoGear^.Tex <> nil then
  1072                         if CurAmmoGear^.Tex <> nil then
  1065                             DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex);
  1073                             DrawTextureCentered(sx, sy - 40, CurAmmoGear^.Tex);
  1066                         DrawAltWeapon(Gear, sx, sy)
  1074                         DrawAltWeapon(Gear, sx, sy)
  1067                         end;
  1075                         end;
  1068                 gtShover: DrawSpritePivotedF(sprHandBaseball, sx + 9 * sign, sy + 2, CurAmmoGear^.Tag, sign, -8, 1, aangle);
  1076                 gtShover: DrawSpritePivotedF(sprHandBaseball,
       
  1077                     sx + 9 * sign, sy + 2, CurAmmoGear^.Tag, sign, -8, 1, aangle);
       
  1078                 gtMinigun: DrawSpritePivotedF(sprMinigun,
       
  1079                     sx + 20 * sign, sy + 4, CurAmmoGear^.Tag, sign, -18, -2, aangle);
  1069                 end;
  1080                 end;
  1070             end
  1081             end
  1071         end;
  1082         end;
  1072 
  1083 
  1073     with HH^ do
  1084     with HH^ do
  1194     vg: PVisualGear;
  1205     vg: PVisualGear;
  1195     i: Longword;
  1206     i: Longword;
  1196     aAngle: real;
  1207     aAngle: real;
  1197     startX, endX, startY, endY: LongInt;
  1208     startX, endX, startY, endY: LongInt;
  1198 begin
  1209 begin
  1199     if Gear^.State and gstFrozen <> 0 then Tint($A0, $A0, $FF, $FF);
  1210 	// airmine has its own sprite
       
  1211     if (Gear^.State and gstFrozen <> 0) and (Gear^.Kind <> gtAirMine) then Tint($A0, $A0, $FF, $FF);
  1200     //if Gear^.State and gstFrozen <> 0 then Tint(IceColor or $FF);
  1212     //if Gear^.State and gstFrozen <> 0 then Tint(IceColor or $FF);
  1201     if Gear^.Target.X <> NoPointX then
  1213     if Gear^.Target.X <> NoPointX then
  1202         if Gear^.AmmoType = amBee then
  1214         if Gear^.AmmoType = amBee then
  1203             DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
  1215             DrawSpriteRotatedF(sprTargetBee, Gear^.Target.X + WorldDx, Gear^.Target.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
  1204     else if Gear^.AmmoType = amIceGun then
  1216     else if Gear^.AmmoType = amIceGun then
  1225                   untint;
  1237                   untint;
  1226                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
  1238                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
  1227                   end;
  1239                   end;
  1228        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
  1240        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
  1229 
  1241 
  1230        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
  1242        gtPortal: begin
       
  1243                  if ((Gear^.Tag and 1) = 0) // still moving?
  1231                  or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked?
  1244                  or (Gear^.LinkedGear = nil) or (Gear^.LinkedGear^.LinkedGear <> Gear) // not linked&backlinked?
  1232                  or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving?
  1245                  or ((Gear^.LinkedGear^.Tag and 1) = 0) then // linked portal still moving?
  1233                       DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
  1246                      DrawSpriteRotatedF(sprPortal, x, y, Gear^.Tag, hwSign(Gear^.dX), Gear^.DirAngle)
  1234                  else DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
  1247                  else
       
  1248                      DrawSpriteRotatedF(sprPortal, x, y, 4 + Gear^.Tag div 2, hwSign(Gear^.dX), Gear^.DirAngle);
       
  1249 
       
  1250                  // Portal ball trace effects
       
  1251                  if ((Gear^.Tag and 1) = 0) and ((GameTicks mod 4) = 0) and (not isPaused) then
       
  1252                      begin
       
  1253                      vg:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtDust, 1);
       
  1254                      if vg <> nil then
       
  1255                          if Gear^.Tag = 0 then
       
  1256                              vg^.Tint:= $fab02ab0
       
  1257                          else if Gear^.Tag = 2 then
       
  1258                              vg^.Tint:= $364df7b0;
       
  1259                      end;
       
  1260                  end;
  1235 
  1261 
  1236            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
  1262            gtDrill: if (Gear^.State and gsttmpFlag) <> 0 then
  1237                         DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
  1263                         DrawSpriteRotated(sprAirDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX))
  1238                     else
  1264                     else
  1239                         DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1265                         DrawSpriteRotated(sprDrill, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1241         gtHedgehog: DrawHH(Gear, x, y);
  1267         gtHedgehog: DrawHH(Gear, x, y);
  1242 
  1268 
  1243            gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1269            gtShell: DrawSpriteRotated(sprBazookaShell, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1244 
  1270 
  1245            gtGrave: begin
  1271            gtGrave: begin
  1246                     DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (GameTicks shr 7+Gear^.uid) and 15, 1, 32, 32);
  1272                     DrawTextureF(Gear^.Hedgehog^.Team^.GraveTex, 1, x, y, (RealTicks shr 7+Gear^.uid) and 15, 1, 32, 32);
  1247                     if Gear^.Health > 0 then
  1273                     if Gear^.Health > 0 then
  1248                         begin
  1274                         begin
  1249                         //Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750))));
  1275                         //Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750))));
  1250                         Tint($f5, $db, $35, max($40, round($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health)))));
  1276                         Tint($f5, $db, $35, max($40, round($FF * abs(1 - (RealTicks mod 1500) / (750 + Gear^.Health)))));
  1251                         //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
  1277                         //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
  1252                         DrawSprite(sprVampiric, x - 24, y - 24, 0);
  1278                         DrawSprite(sprVampiric, x - 24, y - 24, 0);
  1253                         untint
  1279                         untint
  1254                         end
  1280                         end
  1255                     end;
  1281                     end;
  1256              gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1282              gtBee: DrawSpriteRotatedF(sprBee, x, y, (RealTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1257       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
  1283       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
  1258             gtRope: DrawRope(Gear);
  1284             gtRope: DrawRope(Gear);
  1259 
  1285 
  1260             gtMine: begin
  1286             gtMine: begin
  1261                     if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
  1287                     if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
  1262                            DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle)
  1288                            DrawSpriteRotated(sprMineOff, x, y, 0, Gear^.DirAngle)
  1263                     else if Gear^.Health <> 0 then
  1289                     else if Gear^.Health <> 0 then
  1264                        DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
  1290                        DrawSpriteRotated(sprMineOn, x, y, 0, Gear^.DirAngle)
  1265                     else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
  1291                     else DrawSpriteRotated(sprMineDead, x, y, 0, Gear^.DirAngle);
  1266                     end;
  1292                     end;
  1267          gtAirMine: if Gear^.State and gstTmpFlag = 0 then                // mine is inactive
  1293          gtAirMine: 
  1268                         begin
  1294 					if (Gear^.State and gstFrozen <> 0) then 
  1269                         Tint(150,150,150,255);
  1295                         DrawSprite(sprFrozenAirMine, x-16, y-16, 15)
       
  1296 					else if (Gear^.State and gstTmpFlag = 0) then                // mine is inactive
       
  1297                         begin
       
  1298 						if (Gear^.State and gstTmpFlag = 0) then Tint(150,150,150,255);
  1270                         DrawSprite(sprAirMine, x-16, y-16, 15);
  1299                         DrawSprite(sprAirMine, x-16, y-16, 15);
  1271                         untint
  1300                         untint
  1272                         end
  1301                         end
  1273                     else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then  // mine is chasing a hog
  1302                     else if (Gear^.Hedgehog <> nil) and (Gear^.Hedgehog^.Gear <> nil) then  // mine is chasing a hog
  1274                          DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25) mod 16)
  1303                          DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 25 + Gear^.Uid) mod 16)
  1275                     else if Gear^.State and gstChooseTarget <> 0 then   // mine is seeking for hogs
  1304                     else if Gear^.State and gstChooseTarget <> 0 then   // mine is seeking for hogs
  1276                          DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 125) mod 16)
  1305                          DrawSprite(sprAirMine, x-16, y-16, (RealTicks div 125 + Gear^.Uid) mod 16)
  1277                     else
  1306                     else
  1278                          DrawSprite(sprAirMine, x-16, y-16, 4);           // mine is active but not seeking
  1307                          DrawSprite(sprAirMine, x-16, y-16, 4);           // mine is active but not seeking
  1279 
  1308 
  1280            gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
  1309            gtSMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
  1281                            DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle)
  1310                            DrawSpriteRotated(sprSMineOff, x, y, 0, Gear^.DirAngle)
  1291                             begin
  1320                             begin
  1292                             if Gear^.State and gstFrozen <> 0 then
  1321                             if Gear^.State and gstFrozen <> 0 then
  1293                                 DrawSprite(sprCase, x - 24, y - 28, 0)
  1322                                 DrawSprite(sprCase, x - 24, y - 28, 0)
  1294                             else
  1323                             else
  1295                                 begin
  1324                                 begin
  1296                                 i:= (GameTicks shr 6) mod 64;
  1325                                 i:= (RealTicks shr 6) mod 64;
  1297                                 if i > 18 then i:= 0;
  1326                                 if i > 18 then i:= 0;
  1298                                 DrawSprite(sprCase, x - 24, y - 24, i)
  1327                                 DrawSprite(sprCase, x - 24, y - 24, i)
  1299                                 end
  1328                                 end
  1300                             end
  1329                             end
  1301                         else if ((Gear^.Pos and posCaseHealth) <> 0) then
  1330                         else if ((Gear^.Pos and posCaseHealth) <> 0) then
  1302                             begin
  1331                             begin
  1303                             if Gear^.State and gstFrozen <> 0 then
  1332                             if Gear^.State and gstFrozen <> 0 then
  1304                                 DrawSprite(sprFAid, x - 24, y - 28, 0)
  1333                                 DrawSprite(sprFAid, x - 24, y - 28, 0)
  1305                             else
  1334                             else
  1306                                 begin
  1335                                 begin
  1307                                 i:= ((GameTicks shr 6) + 38) mod 64;
  1336                                 i:= ((RealTicks shr 6) + 38) mod 64;
  1308                                 if i > 13 then i:= 0;
  1337                                 if i > 13 then i:= 0;
  1309                                 DrawSprite(sprFAid, x - 24, y - 24, i)
  1338                                 DrawSprite(sprFAid, x - 24, y - 24, i)
  1310                                 end
  1339                                 end
  1311                             end
  1340                             end
  1312                         else if ((Gear^.Pos and posCaseUtility) <> 0) then
  1341                         else if ((Gear^.Pos and posCaseUtility) <> 0) then
  1313                             begin
  1342                             begin
  1314                             if Gear^.State and gstFrozen <> 0 then
  1343                             if Gear^.State and gstFrozen <> 0 then
  1315                                 DrawSprite(sprUtility, x - 24, y - 28, 0)
  1344                                 DrawSprite(sprUtility, x - 24, y - 28, 0)
  1316                             else
  1345                             else
  1317                                 begin
  1346                                 begin
  1318                                 i:= (GameTicks shr 6) mod 70;
  1347                                 i:= (RealTicks shr 6) mod 70;
  1319                                 if i > 23 then i:= 0;
  1348                                 if i > 23 then i:= 0;
  1320                                 i:= i mod 12;
  1349                                 i:= i mod 12;
  1321                                 DrawSprite(sprUtility, x - 24, y - 24, i)
  1350                                 DrawSprite(sprUtility, x - 24, y - 24, i)
  1322                                 end
  1351                                 end
  1323                             end
  1352                             end
  1331       gtExplosives: begin
  1360       gtExplosives: begin
  1332                     if ((Gear^.State and gstDrowning) <> 0) then
  1361                     if ((Gear^.State and gstDrowning) <> 0) then
  1333                         DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0)
  1362                         DrawSprite(sprExplosivesRoll, x - 24, y - 24, 0)
  1334                     else if Gear^.State and gstAnimation = 0 then
  1363                     else if Gear^.State and gstAnimation = 0 then
  1335                         begin
  1364                         begin
  1336                         i:= (GameTicks shr 6 + Gear^.uid*3) mod 64;
  1365                         i:= (RealTicks shr 6 + Gear^.uid*3) mod 64;
  1337                         if i > 18 then
  1366                         if i > 18 then
  1338                             i:= 0;
  1367                             i:= 0;
  1339                         DrawSprite(sprExplosives, x - 24, y - 24, i)
  1368                         DrawSprite(sprExplosives, x - 24, y - 24, i)
  1340                         end
  1369                         end
  1341                     else if Gear^.State and gsttmpFlag = 0 then
  1370                     else if Gear^.State and gsttmpFlag = 0 then
  1367 
  1396 
  1368                     end;
  1397                     end;
  1369      gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
  1398      gtClusterBomb: DrawSpriteRotated(sprClusterBomb, x, y, 0, Gear^.DirAngle);
  1370          gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0);
  1399          gtCluster: DrawSprite(sprClusterParticle, x - 8, y - 8, 0);
  1371            gtFlame: if Gear^.Tag and 1 = 0 then
  1400            gtFlame: if Gear^.Tag and 1 = 0 then
  1372                          DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16)
  1401                          DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (RealTicks shr 7 + LongWord(Gear^.Tag)) mod 8, 1, 16, 16)
  1373                     else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (GameTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16);
  1402                     else DrawTextureF(SpritesData[sprFlame].Texture, 2 / (Gear^.Tag mod 3 + 2), x, y, (RealTicks shr 7 + LongWord(Gear^.Tag)) mod 8, -1, 16, 16);
  1374        gtParachute: begin
  1403        gtParachute: begin
  1375                     DrawSprite(sprParachute, x - 24, y - 48, 0);
  1404                     DrawSprite(sprParachute, x - 24, y - 48, 0);
  1376                     DrawAltWeapon(Gear, x + 1, y - 3)
  1405                     DrawAltWeapon(Gear, x + 1, y - 3)
  1377                     end;
  1406                     end;
  1378        gtAirAttack: begin
  1407        gtAirAttack: begin
  1389                         if ((Gear^.State and gstAnimation) <> 0) then
  1418                         if ((Gear^.State and gstAnimation) <> 0) then
  1390                             DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
  1419                             DrawSpriteRotatedF(sprTeleport, x + 1, y - 3, Gear^.Pos, hwSign(Gear^.dX), 0);
  1391                         DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0)
  1420                         DrawSpriteRotatedF(sprTeleport, hwRound(HHGear^.X) + 1 + WorldDx, hwRound(HHGear^.Y) - 3 + WorldDy, 11 - Gear^.Pos, hwSign(HHGear^.dX), 0)
  1392                         end
  1421                         end
  1393                     end;
  1422                     end;
  1394         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12);
  1423         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (RealTicks shr 6) mod 12);
  1395           gtTarget: begin
  1424           gtTarget: begin
  1396                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
  1425                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
  1397                     DrawSprite(sprTarget, x - 16, y - 16, 0);
  1426                     DrawSprite(sprTarget, x - 16, y - 16, 0);
  1398                     untint;
  1427                     untint;
  1399                     end;
  1428                     end;
  1546                                     DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40);
  1575                                     DrawLine(hwRound(HHGear^.X), hwRound(HHGear^.Y), hwRound(Gear^.X), hwRound(Gear^.Y), 4.0, i, i, $FF, $40);
  1547                                     end;
  1576                                     end;
  1548                                 end
  1577                                 end
  1549                           end
  1578                           end
  1550                       end;
  1579                       end;
  1551             gtDuck: DrawSpriteRotatedF(sprDuck, x, y, 1, Gear^.Tag, Gear^.DirAngle);
  1580             gtDuck: DrawSpriteRotatedF(sprDuck, x, y, 1, Gear^.Tag, 
  1552             gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF);  // debug
  1581                     // replace with something based on dx/dy?
       
  1582                     Gear^.DirAngle + 10-round(20 * abs(1 - (RealTicks mod round(0.1/max(0.00005,cWindSpeedf))) / round(0.05/max(0.00005,cWindSpeedf))) ));
       
  1583             gtGenericFaller: begin
       
  1584                              // DEBUG: draw gtGenericFaller
       
  1585                              if Gear^.Tag <> 0 then
       
  1586                                  DrawCircle(x, y, max(3, Gear^.Radius), 3, $FF, $00, $00, $FF)
       
  1587                              else
       
  1588                                  DrawCircle(x, y, max(3, Gear^.Radius), 3, $80, $FF, $80, $8F);
       
  1589                              end;
  1553          end;
  1590          end;
  1554     if Gear^.State and gstFrozen <> 0 then untint
  1591     if Gear^.State and gstFrozen <> 0 then untint
  1555 end;
  1592 end;
  1556 
  1593 
  1557 procedure RenderGearTimer(Gear: PGear; x, y: LongInt);
  1594 procedure RenderGearTimer(Gear: PGear; x, y: LongInt);