hedgewars/uGearsRender.pas
changeset 10040 4ac87acbaed9
parent 10015 4feced261c68
parent 10032 db65298717da
child 10080 ac51bcb534ef
equal deleted inserted replaced
10019:c00db97a668f 10040:4ac87acbaed9
   806 
   806 
   807     with HH^ do
   807     with HH^ do
   808         begin
   808         begin
   809         if defaultPos then
   809         if defaultPos then
   810             begin
   810             begin
   811             if HH^.Team^.hasGone then Tint($FF, $FF, $FF, $80);
   811             if HH^.Team^.hasGone then
       
   812                  Tint($FFFFFF80)
       
   813             else if HH^.Effects[hePoisoned] <> 0 then
       
   814                  Tint($B7FFBCFF)
       
   815             else Tint(HH^.Gear^.Tint);
   812             DrawSpriteRotatedF(sprHHIdle,
   816             DrawSpriteRotatedF(sprHHIdle,
   813                 sx,
   817                 sx,
   814                 sy,
   818                 sy,
   815                 (RealTicks div 128 + Gear^.Pos) mod 19,
   819                 (RealTicks div 128 + Gear^.Pos) mod 19,
       
   820                 sign,
       
   821                 0);
       
   822             untint;
       
   823             DrawSpriteRotatedF(sprHHIdle,
       
   824                 sx,
       
   825                 sy,
       
   826                 (RealTicks div 128 + Gear^.Pos) mod 19 + 32,
   816                 sign,
   827                 sign,
   817                 0);
   828                 0);
   818             HatVisible:= true;
   829             HatVisible:= true;
   819             end;
   830             end;
   820 
   831 
  1050                   else DrawSprite(sprMolotov, x, y, 8);
  1061                   else DrawSprite(sprMolotov, x, y, 8);
  1051 
  1062 
  1052        gtRCPlane: begin
  1063        gtRCPlane: begin
  1053                   aangle:= Gear^.Angle * 360 / 4096;
  1064                   aangle:= Gear^.Angle * 360 / 4096;
  1054                   if Gear^.Tag < 0 then aangle:= 360-aangle;
  1065                   if Gear^.Tag < 0 then aangle:= 360-aangle;
  1055                   Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1066                   Tint(Gear^.Tint);
  1056                   DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
  1067                   DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
  1057                   untint;
  1068                   untint;
  1058                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
  1069                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
  1059                   end;
  1070                   end;
  1060        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
  1071        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
  1172        gtParachute: begin
  1183        gtParachute: begin
  1173                     DrawSprite(sprParachute, x - 24, y - 48, 0);
  1184                     DrawSprite(sprParachute, x - 24, y - 48, 0);
  1174                     DrawAltWeapon(Gear, x + 1, y - 3)
  1185                     DrawAltWeapon(Gear, x + 1, y - 3)
  1175                     end;
  1186                     end;
  1176        gtAirAttack: begin
  1187        gtAirAttack: begin
  1177                     Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1188                     Tint(Gear^.Tint);
  1178                     DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
  1189                     DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
  1179                     untint;
  1190                     untint;
  1180                     DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
  1191                     DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
  1181                     end;
  1192                     end;
  1182          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1193          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1248                         end;
  1259                         end;
  1249                     DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y, 0, 1, 128, 128);
  1260                     DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y, 0, 1, 128, 128);
  1250                     end;
  1261                     end;
  1251      gtPoisonCloud: begin
  1262      gtPoisonCloud: begin
  1252                     if Gear^.Timer < 1020 then
  1263                     if Gear^.Timer < 1020 then
  1253                         Tint($C0, $C0, $00, Gear^.Timer div 8)
  1264                         Tint(Gear^.Tint and $FFFFFF00 or Gear^.Timer div 8)
  1254                     else if Gear^.Timer > 3980 then
  1265                     else if Gear^.Timer > 3980 then
  1255                         Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
  1266                         Tint(Gear^.Tint and $FFFFFF00 or (5000 - Gear^.Timer) div 8)
  1256                     else
  1267                     else
  1257                         Tint($C0, $C0, $00, $C0);
  1268                         Tint(Gear^.Tint);
  1258                     DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
  1269                     DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
  1259                     untint
  1270                     untint
  1260                     end;
  1271                     end;
  1261      gtResurrector: begin
  1272      gtResurrector: begin
  1262                     DrawSpriteRotated(sprCross, x, y, 0, 0);
  1273                     DrawSpriteRotated(sprCross, x, y, 0, 0);
  1263                     Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
  1274                     Tint(Gear^.Tint and $FFFFFF00 or max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
  1264                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
  1275                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
  1265                     untint;
  1276                     untint;
  1266                     end;
  1277                     end;
  1267       gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1278       gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1268            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
  1279            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
  1269                         begin
  1280                         begin
  1270                         Tint((ExplosionBorderColor shr RShift) and $FF,
  1281                         Tint(Gear^.Tint);
  1271                              (ExplosionBorderColor shr GShift) and $FF,
       
  1272                              (ExplosionBorderColor shr BShift) and $FF,
       
  1273                              $FF);
       
  1274                         // Needs a nicer white texture to tint
  1282                         // Needs a nicer white texture to tint
  1275                         DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
  1283                         DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
  1276                         //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
  1284                         //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
  1277                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
  1285                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
  1278                         untint;
  1286                         untint;