hedgewars/uGearsRender.pas
branchwebgl
changeset 9950 2759212a27de
parent 9521 8054d9d775fd
parent 9809 1e32628eb167
child 10015 4feced261c68
equal deleted inserted replaced
9521:8054d9d775fd 9950:2759212a27de
    75 
    75 
    76     Tint($C0, $C0, $C0, $FF);
    76     Tint($C0, $C0, $C0, $FF);
    77 
    77 
    78     glVertexPointer(2, GL_FLOAT, 0, @RopePoints.rounded[0]);
    78     glVertexPointer(2, GL_FLOAT, 0, @RopePoints.rounded[0]);
    79     glDrawArrays(GL_LINE_STRIP, 0, RopePoints.Count + 2);
    79     glDrawArrays(GL_LINE_STRIP, 0, RopePoints.Count + 2);
    80     Tint($FF, $FF, $FF, $FF);
    80     untint;
    81 
    81 
    82     glPopMatrix;
    82     glPopMatrix;
    83 
    83 
    84     glEnable(GL_TEXTURE_2D);
    84     glEnable(GL_TEXTURE_2D);
    85     //glDisable(GL_LINE_SMOOTH)
    85     //glDisable(GL_LINE_SMOOTH)
   233     if (Gear^.State and gstHHDeath) <> 0 then
   233     if (Gear^.State and gstHHDeath) <> 0 then
   234         begin
   234         begin
   235         DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos);
   235         DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos);
   236         Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   236         Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   237         DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos + 8);
   237         DrawSprite(sprHHDeath, ox - 16, oy - 26, Gear^.Pos + 8);
   238         Tint($FF, $FF, $FF, $FF);
   238         untint;
   239         exit
   239         exit
   240         end
   240         end
   241     else if (Gear^.State and gstHHGone) <> 0 then
   241     else if (Gear^.State and gstHHGone) <> 0 then
   242         begin
   242         begin
   243         DrawSpriteRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0);
   243         DrawSpriteRotatedF(sprTeleport, sx, sy, Gear^.Pos, sign, 0);
   274 
   274 
   275     if HH^.Effects[hePoisoned] <> 0 then
   275     if HH^.Effects[hePoisoned] <> 0 then
   276         begin
   276         begin
   277         Tint($00, $FF, $40, $40);
   277         Tint($00, $FF, $40, $40);
   278         DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
   278         DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 2, 0, 0, sx, sy, 0, 1, 22, 22, (RealTicks shr 36) mod 360);
   279         Tint($FF, $FF, $FF, $FF)
   279         untint
   280         end;
   280         end;
   281 
   281 
   282 
   282 
   283     if ((Gear^.State and gstWinner) <> 0) and
   283     if ((Gear^.State and gstWinner) <> 0) and
   284     ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
   284     ((CurAmmoGear = nil) or (CurAmmoGear^.Kind <> gtPickHammer)) then
   373                 end;
   373                 end;
   374             // draw crosshair
   374             // draw crosshair
   375             CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
   375             CrosshairX := Round(hwRound(Gear^.X) + dx * 80 + GetLaunchX(HH^.CurAmmoType, sign * m, Gear^.Angle));
   376             CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
   376             CrosshairY := Round(hwRound(Gear^.Y) + dy * 80 + GetLaunchY(HH^.CurAmmoType, Gear^.Angle));
   377 
   377 
   378 
   378             setTintAdd(true);
   379             DrawTextureRotated(HH^.Team^.CrosshairTex,
   379             Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
       
   380             DrawTextureRotated(CrosshairTexture,
   380                     12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
   381                     12, 12, CrosshairX + WorldDx, CrosshairY + WorldDy, 0,
   381                     sign * (Gear^.Angle * 180.0) / cMaxAngle);
   382                     sign * m * (Gear^.Angle * 180.0) / cMaxAngle);
       
   383             untint;
       
   384             setTintAdd(false);
   382             end;
   385             end;
       
   386 
   383         hx:= ox + 8 * sign;
   387         hx:= ox + 8 * sign;
   384         hy:= oy - 2;
   388         hy:= oy - 2;
   385         aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
   389         aangle:= Gear^.Angle * 180 / cMaxAngle - 90;
   386         if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then
   390         if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind <> gtTardis) then
   387         begin
   391         begin
   432                                 if HatTex^.w > 64 then
   436                                 if HatTex^.w > 64 then
   433                                     begin
   437                                     begin
   434                                     Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   438                                     Tint(HH^.Team^.Clan^.Color shl 8 or $FF);
   435                                     DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
   439                                     DrawTextureRotatedF(HatTex, 1.0, -1.0, -6.0, ox, oy, 32, i, 32, 32,
   436                                         i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   440                                         i*DxDy2Angle(CurAmmoGear^.dY, CurAmmoGear^.dX) + hAngle);
   437                                     Tint($FF, $FF, $FF, $FF)
   441                                     untint
   438                                     end
   442                                     end
   439                                 end
   443                                 end
   440                     end;
   444                     end;
   441                     DrawAltWeapon(Gear, ox, oy);
   445                     DrawAltWeapon(Gear, ox, oy);
   442                     defaultPos:= false
   446                     defaultPos:= false
   469                                     sy - 5,
   473                                     sy - 5,
   470                                     32,
   474                                     32,
   471                                     sign,
   475                                     sign,
   472                                     32,
   476                                     32,
   473                                     32);
   477                                     32);
   474                                 Tint($FF, $FF, $FF, $FF)
   478                                 untint
   475                                 end
   479                                 end
   476                             end;
   480                             end;
   477                     defaultPos:= false
   481                     defaultPos:= false
   478                     end;
   482                     end;
   479                 gtShover: DrawSpriteRotated(sprHandBaseball, hx, hy, sign, aangle + 180);
   483                 gtShover: DrawSpriteRotated(sprHandBaseball, hx, hy, sign, aangle + 180);
   673                 amSeduction: begin
   677                 amSeduction: begin
   674                              DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle);
   678                              DrawSpriteRotated(sprHandSeduction, hx, hy, sign, aangle);
   675                              DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA);
   679                              DrawCircle(ox, oy, 248, 4, $FF, $00, $00, $AA);
   676                              //Tint($FF, $0, $0, $AA);
   680                              //Tint($FF, $0, $0, $AA);
   677                              //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10);
   681                              //DrawTexture(ox - 240, oy - 240, SpritesData[sprVampiric].Texture, 10);
   678                              //Tint($FF, $FF, $FF, $FF);
   682                              //untint;
   679                              end;
   683                              end;
   680                 amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   684                 amVampiric: DrawSpriteRotatedF(sprHandVamp, hx, hy, (RealTicks div 125) mod 4, sign, aangle);
   681                 amRCPlane: begin
   685                 amRCPlane: begin
   682                     DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
   686                     DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
   683                     defaultPos:= false
   687                     defaultPos:= false
   684                     end;
   688                     end;
       
   689                 amRubber,
   685                 amGirder: begin
   690                 amGirder: begin
   686                     DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle);
   691                     DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle);
   687                     if WorldEdge = weWrap then
   692                     if WorldEdge = weWrap then
   688                         begin
   693                         begin
   689                         if hwRound(Gear^.X) < leftX+256 then
   694                         if hwRound(Gear^.X) < LongInt(leftX) + 256 then
   690                             DrawSpriteClipped(sprGirder,
   695                             DrawSpriteClipped(sprGirder,
   691                                             rightX+(ox-leftX)-256,
   696                                             rightX+(ox-leftX)-256,
   692                                             oy-256,
   697                                             oy-256,
   693                                             LongInt(topY)+WorldDy,
   698                                             LongInt(topY)+WorldDy,
   694                                             LongInt(rightX)+WorldDx,
   699                                             LongInt(rightX)+WorldDx,
   842                         sy - 5,
   847                         sy - 5,
   843                         (RealTicks div 128 + Gear^.Pos) mod 19 + 32,
   848                         (RealTicks div 128 + Gear^.Pos) mod 19 + 32,
   844                         sign,
   849                         sign,
   845                         32,
   850                         32,
   846                         32);
   851                         32);
   847                     Tint($FF, $FF, $FF, $FF)
   852                     untint
   848                     end;
   853                     end;
   849                 if HH^.Team^.hasGone then Tint($FF, $FF, $FF, $FF)
   854                 if HH^.Team^.hasGone then untint
   850                 end
   855                 end
   851             else
   856             else
   852                 begin
   857                 begin
   853                 DrawTextureF(HatTex,
   858                 DrawTextureF(HatTex,
   854                     HatVisibility,
   859                     HatVisibility,
   867                         sy - 5,
   872                         sy - 5,
   868                         32,
   873                         32,
   869                         sign*m,
   874                         sign*m,
   870                         32,
   875                         32,
   871                         32);
   876                         32);
   872                     Tint($FF, $FF, $FF, $FF)
   877                     untint
   873                     end
   878                     end
   874                 end
   879                 end
   875         end;
   880         end;
   876     if (Gear^.State and gstHHDriven) <> 0 then
   881     if (Gear^.State and gstHHDriven) <> 0 then
   877         begin
   882         begin
   927                 begin
   932                 begin
   928                 dec(t, Team^.NameTagTex^.h + 2);
   933                 dec(t, Team^.NameTagTex^.h + 2);
   929                 DrawTextureCentered(ox, t, Team^.NameTagTex)
   934                 DrawTextureCentered(ox, t, Team^.NameTagTex)
   930                 end;
   935                 end;
   931             if (cTagsMask and htTransparent) <> 0 then
   936             if (cTagsMask and htTransparent) <> 0 then
   932                 Tint($FF, $FF, $FF, $FF)
   937                 untint
   933             end;
   938             end;
   934         if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
   939         if (Gear^.State and gstHHDriven) <> 0 then // Current hedgehog
   935             begin
   940             begin
   936             if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then
   941             if (CurAmmoGear <> nil) and (CurAmmoGear^.Kind = gtResurrector) then
   937                 DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex);
   942                 DrawTextureCentered(ox, sy - cHHRadius - 7 - HealthTagTex^.h, HealthTagTex);
   955         begin
   960         begin
   956         Tint($f5, $db, $35, $20);
   961         Tint($f5, $db, $35, $20);
   957         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
   962         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
   958         end;
   963         end;
   959 
   964 
   960     if Gear^.Invulnerable then
   965     if (Gear^.Hedgehog^.Effects[heInvulnerable] <> 0) then
   961         begin
   966         begin
   962         Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750))));
   967         Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - ((RealTicks div 2 + Gear^.uid * 491) mod 1500) / 750))));
   963         DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0);
   968         DrawSprite(sprInvulnerable, sx - 24, sy - 24, 0);
   964         end;
   969         end;
   965 
   970 
   978         else
   983         else
   979         DrawTextureFromRectDir(sx-16 + sign*2, sy+16-iceoffset, r.w, r.h, @r, HHTexture, sign);
   984         DrawTextureFromRectDir(sx-16 + sign*2, sy+16-iceoffset, r.w, r.h, @r, HHTexture, sign);
   980 
   985 
   981 
   986 
   982         if HH^.Effects[heFrozen] < 150000 then
   987         if HH^.Effects[heFrozen] < 150000 then
   983             Tint($FF, $FF, $FF, $FF);
   988             untint;
   984         end;
   989         end;
   985 
   990 
   986 
   991 
   987     if cVampiric and
   992     if cVampiric and
   988     (CurrentHedgehog^.Gear <> nil) and
   993     (CurrentHedgehog^.Gear <> nil) and
   989     (CurrentHedgehog^.Gear = Gear) then
   994     (CurrentHedgehog^.Gear = Gear) then
   990         begin
   995         begin
   991         Tint($FF, 0, 0, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
   996         Tint($FF, 0, 0, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
   992         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
   997         DrawSprite(sprVampiric, sx - 24, sy - 24, 0);
   993         end;
   998         end;
   994         Tint($FF, $FF, $FF, $FF)
   999         untint
   995 end;
  1000 end;
   996 
  1001 
   997 
  1002 
   998 procedure RenderGear(Gear: PGear; x, y: LongInt);
  1003 procedure RenderGear(Gear: PGear; x, y: LongInt);
   999 var
  1004 var
  1027        gtRCPlane: begin
  1032        gtRCPlane: begin
  1028                   aangle:= Gear^.Angle * 360 / 4096;
  1033                   aangle:= Gear^.Angle * 360 / 4096;
  1029                   if Gear^.Tag < 0 then aangle:= 360-aangle;
  1034                   if Gear^.Tag < 0 then aangle:= 360-aangle;
  1030                   Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1035                   Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1031                   DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
  1036                   DrawSpriteRotatedF(sprPlane, x, y, 0, Gear^.Tag, aangle - 90);
  1032                   Tint($FF, $FF, $FF, $FF);
  1037                   untint;
  1033                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
  1038                   DrawSpriteRotatedF(sprPlane, x, y, 1, Gear^.Tag, aangle - 90)
  1034                   end;
  1039                   end;
  1035        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
  1040        gtBall: DrawSpriteRotatedF(sprBalls, x, y, Gear^.Tag,0, Gear^.DirAngle);
  1036 
  1041 
  1037        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
  1042        gtPortal: if ((Gear^.Tag and 1) = 0) // still moving?
  1055                         begin
  1060                         begin
  1056                         //Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750))));
  1061                         //Tint($33, $33, $FF, max($40, round($FF * abs(1 - (GameTicks mod (6000 div Gear^.Health)) / 750))));
  1057                         Tint($f5, $db, $35, max($40, round($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health)))));
  1062                         Tint($f5, $db, $35, max($40, round($FF * abs(1 - (GameTicks mod 1500) / (750 + Gear^.Health)))));
  1058                         //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
  1063                         //Tint($FF, $FF, $FF, max($40, round($FF * abs(1 - (RealTicks mod 1500) / 750))));
  1059                         DrawSprite(sprVampiric, x - 24, y - 24, 0);
  1064                         DrawSprite(sprVampiric, x - 24, y - 24, 0);
  1060                         Tint($FF, $FF, $FF, $FF)
  1065                         untint
  1061                         end
  1066                         end
  1062                     end;
  1067                     end;
  1063              gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1068              gtBee: DrawSpriteRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1064       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
  1069       gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
  1065             gtRope: DrawRope(Gear);
  1070             gtRope: DrawRope(Gear);
  1149                     DrawAltWeapon(Gear, x + 1, y - 3)
  1154                     DrawAltWeapon(Gear, x + 1, y - 3)
  1150                     end;
  1155                     end;
  1151        gtAirAttack: begin
  1156        gtAirAttack: begin
  1152                     Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1157                     Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF);
  1153                     DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
  1158                     DrawSpriteRotatedF(sprAirplane, x, y, 0, Gear^.Tag, 0);
  1154                     Tint($FF, $FF, $FF, $FF);
  1159                     untint;
  1155                     DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
  1160                     DrawSpriteRotatedF(sprAirplane, x, y, 1, Gear^.Tag, 0);
  1156                     end;
  1161                     end;
  1157          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1162          gtAirBomb: DrawSpriteRotated(sprAirBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1158         gtTeleport: begin
  1163         gtTeleport: begin
  1159                     HHGear:= Gear^.Hedgehog^.Gear;
  1164                     HHGear:= Gear^.Hedgehog^.Gear;
  1163                     end;
  1168                     end;
  1164         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12);
  1169         gtSwitcher: DrawSprite(sprSwitch, x - 16, y - 56, (GameTicks shr 6) mod 12);
  1165           gtTarget: begin
  1170           gtTarget: begin
  1166                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
  1171                     Tint($FF, $FF, $FF, round($FF * Gear^.Timer / 1000));
  1167                     DrawSprite(sprTarget, x - 16, y - 16, 0);
  1172                     DrawSprite(sprTarget, x - 16, y - 16, 0);
  1168                     Tint($FF, $FF, $FF, $FF);
  1173                     untint;
  1169                     end;
  1174                     end;
  1170           gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1175           gtMortar: DrawSpriteRotated(sprMortar, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1171           gtCake: if Gear^.Pos = 6 then
  1176           gtCake: if Gear^.Pos = 6 then
  1172                      DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
  1177                      DrawSpriteRotatedF(sprCakeWalk, x, y, (GameTicks div 40) mod 6, hwSign(Gear^.dX), Gear^.DirAngle * hwSign(Gear^.dX) + 90)
  1173                   else
  1178                   else
  1217                     if (Gear^.State and gstDrowning) = 0 then
  1222                     if (Gear^.State and gstDrowning) = 0 then
  1218                         begin
  1223                         begin
  1219                         Tint($FF, $FF, $FF, $10);
  1224                         Tint($FF, $FF, $FF, $10);
  1220                         for i:= 8 downto 1 do
  1225                         for i:= 8 downto 1 do
  1221                             DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128);
  1226                             DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y - hwRound(Gear^.dY * 4 * i), 0, 1, 128, 128);
  1222                         Tint($FF, $FF, $FF, $FF)
  1227                         untint
  1223                         end;
  1228                         end;
  1224                     DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y, 0, 1, 128, 128);
  1229                     DrawTextureF(SpritesData[sprPiano].Texture, 1, x, y, 0, 1, 128, 128);
  1225                     end;
  1230                     end;
  1226      gtPoisonCloud: begin
  1231      gtPoisonCloud: begin
  1227                     if Gear^.Timer < 1020 then
  1232                     if Gear^.Timer < 1020 then
  1229                     else if Gear^.Timer > 3980 then
  1234                     else if Gear^.Timer > 3980 then
  1230                         Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
  1235                         Tint($C0, $C0, $00, (5000 - Gear^.Timer) div 8)
  1231                     else
  1236                     else
  1232                         Tint($C0, $C0, $00, $C0);
  1237                         Tint($C0, $C0, $00, $C0);
  1233                     DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
  1238                     DrawTextureRotatedF(SpritesData[sprSmokeWhite].texture, 3, 0, 0, x, y, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360);
  1234                     Tint($FF, $FF, $FF, $FF)
  1239                     untint
  1235                     end;
  1240                     end;
  1236      gtResurrector: begin
  1241      gtResurrector: begin
  1237                     DrawSpriteRotated(sprCross, x, y, 0, 0);
  1242                     DrawSpriteRotated(sprCross, x, y, 0, 0);
  1238                     Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
  1243                     Tint($f5, $db, $35, max($00, round($C0 * abs(1 - (GameTicks mod 6000) / 3000))));
  1239                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
  1244                     DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
  1240                     Tint($FF, $FF, $FF, $FF);
  1245                     untint;
  1241                     end;
  1246                     end;
  1242       gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1247       gtNapalmBomb: DrawSpriteRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1243            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
  1248            gtFlake: if Gear^.State and (gstDrowning or gstTmpFlag) <> 0  then
  1244                         begin
  1249                         begin
  1245                         Tint((ExplosionBorderColor shr RShift) and $FF,
  1250                         Tint((ExplosionBorderColor shr RShift) and $FF,
  1248                              $FF);
  1253                              $FF);
  1249                         // Needs a nicer white texture to tint
  1254                         // Needs a nicer white texture to tint
  1250                         DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
  1255                         DrawTextureRotatedF(SpritesData[sprSnowDust].Texture, 1, 0, 0, x, y, 0, 1, 8, 8, Gear^.DirAngle);
  1251                         //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
  1256                         //DrawSpriteRotated(sprSnowDust, x, y, 0, Gear^.DirAngle);
  1252                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
  1257                         //DrawTexture(x, y, SpritesData[sprVampiric].Texture, 0.1);
  1253                         Tint($FF, $FF, $FF, $FF);
  1258                         untint;
  1254                         end
  1259                         end
  1255                     else //if not isInLag then
  1260                     else //if not isInLag then
  1256                         begin
  1261                         begin
  1257                         if isInLag and (Gear^.FlightTime < 256) then
  1262                         if isInLag and (Gear^.FlightTime < 256) then
  1258                             inc(Gear^.FlightTime, 8)
  1263                             inc(Gear^.FlightTime, 8)
  1265                         else
  1270                         else
  1266                             DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
  1271                             DrawSpriteRotatedF(sprFlake, x, y, Gear^.Timer, 1, Gear^.DirAngle);
  1267 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer)
  1272 //DrawSprite(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer)
  1268 //DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
  1273 //DrawSpriteRotatedF(sprFlake, x-SpritesData[sprFlake].Width div 2, y-SpritesData[sprFlake].Height div 2, Gear^.Timer, 1, Gear^.DirAngle);
  1269                         if Gear^.FlightTime > 0 then
  1274                         if Gear^.FlightTime > 0 then
  1270                             Tint($FF, $FF, $FF, $FF);
  1275                             untint;
  1271                         end;
  1276                         end;
  1272        //gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
  1277        //gtStructure: DrawSprite(sprTarget, x - 16, y - 16, 0);
  1273           gtTardis: if Gear^.Pos <> 4 then
  1278           gtTardis: if Gear^.Pos <> 4 then
  1274                         begin
  1279                         begin
  1275                         if Gear^.Pos = 2 then
  1280                         if Gear^.Pos = 2 then
  1276                             Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF)
  1281                             Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or $FF)
  1277                         else
  1282                         else
  1278                             Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
  1283                             Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
  1279                         DrawSprite(sprTardis, x-24, y-63,0);
  1284                         DrawSprite(sprTardis, x-24, y-63,0);
  1280                         if Gear^.Pos = 2 then
  1285                         if Gear^.Pos = 2 then
  1281                             Tint($FF, $FF, $FF, $FF)
  1286                             untint
  1282                         else
  1287                         else
  1283                             Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
  1288                             Tint($FF,$FF,$FF,max($00, round(Gear^.Power * (1-abs(0.5 - (GameTicks mod 2000) / 2000)))));
  1284                         DrawSprite(sprTardis, x-24, y-63,1);
  1289                         DrawSprite(sprTardis, x-24, y-63,1);
  1285                         if Gear^.Pos <> 2 then
  1290                         if Gear^.Pos <> 2 then
  1286                             Tint($FF, $FF, $FF, $FF)
  1291                             untint
  1287 (*
  1292 (*
  1288                         Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * abs(1 - (RealTicks mod 500) / 250))));
  1293                         Tint(Gear^.Hedgehog^.Team^.Clan^.Color shl 8 or max($00, round(Gear^.Power * abs(1 - (RealTicks mod 500) / 250))));
  1289                         DrawTexture(x-6, y-70, SpritesData[sprVampiric].Texture, 0.25);
  1294                         DrawTexture(x-6, y-70, SpritesData[sprVampiric].Texture, 0.25);
  1290                         Tint($FF, $FF, $FF, $FF)
  1295                         untint
  1291 *)
  1296 *)
  1292                         end;
  1297                         end;
  1293             gtIceGun: begin
  1298             gtIceGun: begin
  1294                       HHGear := Gear^.Hedgehog^.Gear;
  1299                       HHGear := Gear^.Hedgehog^.Gear;
  1295                       if HHGear <> nil then
  1300                       if HHGear <> nil then
  1323                       end;
  1328                       end;
  1324             gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF);  // debug
  1329             gtGenericFaller: DrawCircle(x, y, 3, 3, $FF, $00, $00, $FF);  // debug
  1325          end;
  1330          end;
  1326       if Gear^.RenderTimer and (Gear^.Tex <> nil) then
  1331       if Gear^.RenderTimer and (Gear^.Tex <> nil) then
  1327           DrawTextureCentered(x + 8, y + 8, Gear^.Tex);
  1332           DrawTextureCentered(x + 8, y + 8, Gear^.Tex);
  1328     if Gear^.State and gstFrozen <> 0 then Tint($FF, $FF, $FF, $FF)
  1333     if Gear^.State and gstFrozen <> 0 then untint
  1329 end;
  1334 end;
  1330 
  1335 
  1331 end.
  1336 end.