Changeset 505 for trunk/LocalPlayer


Ignore:
Timestamp:
Dec 24, 2023, 11:24:57 PM (11 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk/LocalPlayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Battle.pas

    r496 r505  
    112112    VLightGradient(ca, xm - 8, ym + 8 + LABaseDamage, LADamage - LABaseDamage,
    113113      FanaticColor);
    114   BitBltCanvas(ca, xm - 12, ym - 12, 24, 24,
    115     HGrSystem.Mask.Canvas, 26, 146, SRCAND);
    116   BitBltCanvas(ca, xm - 12, ym - 12, 24, 24,
    117     HGrSystem.Data.Canvas, 26, 146, SRCPAINT);
     114  Sprite(ca, HGrSystem, xm - 12, ym - 12, 24, 24, 26, 146);
    118115
    119116  LabelText := Format('%d', [Forecast.AStr]);
     
    139136    BitBltCanvas(ca, xm + 9 + LDDamage - 7, ym - 6, 14, 17,
    140137      HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    141     BitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
    142       HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    143     BitBltCanvas(ca, xm + 8 + LDDamage - 7, ym - 7, 14, 17,
    144       HGrSystem.Data.Canvas, 51, 153, SRCPAINT);
     138    Sprite(ca, HGrSystem, xm + 8 + LDDamage - 7, ym - 7, 14, 17, 51, 153);
    145139  end;
    146140  LabelText := Format('%d', [DDamage]);
     
    159153    BitBltCanvas(ca, xm - 6, ym + 9 + LADamage - 7, 14, 17,
    160154      HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    161     BitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
    162       HGrSystem.Mask.Canvas, 51, 153, SRCAND);
    163     BitBltCanvas(ca, xm - 7, ym + 8 + LADamage - 7, 14, 17,
    164       HGrSystem.Data.Canvas, 51, 153, SRCPAINT);
     155    Sprite(ca, HGrSystem, xm - 7, ym + 8 + LADamage - 7, 14, 17, 51, 153);
    165156  end;
    166157  LabelText := Format('%d', [MyUn[uix].Health - Forecast.EndHealthAtt]);
  • trunk/LocalPlayer/MessgEx.pas

    r484 r505  
    195195  if GameMode = cMovie then
    196196  begin
    197     if not((GameMode = cMovie) and (MovieSpeed = 4)) then
     197    if not ((GameMode = cMovie) and (MovieSpeed = 4)) then
    198198    begin
    199199      MovieCancelled := False;
     
    230230  ix, iy, xDst, yDst, dx, dy, xIcon, yIcon: Integer;
    231231  BookRect: TRect;
    232   x1, xR, yR, share: Single;
     232  x1, xR, yR, Share: Single;
    233233  Screwed: TScrewed;
    234234  SrcPtr: TPixelPointer;
     
    257257          for dy := 0 to 1 do begin
    258258            if dx = 0 then
    259               share := 1 - xR
     259              Share := 1 - xR
    260260            else
    261               share := xR;
     261              Share := xR;
    262262            if dy = 0 then
    263               share := share * (1 - yR)
     263              Share := Share * (1 - yR)
    264264            else
    265               share := share * yR;
     265              Share := Share * yR;
    266266            if (xDst + dx < wScrewed) and
    267267            (yDst + dy < hScrewed) then begin
    268268              Screwed[xDst + dx, yDst + dy, 0] := Screwed[xDst + dx, yDst + dy, 0]
    269                 + share * SrcPtr.Pixel^.B;
     269                + Share * SrcPtr.Pixel^.B;
    270270              Screwed[xDst + dx, yDst + dy, 1] := Screwed[xDst + dx, yDst + dy, 1]
    271                 + share * SrcPtr.Pixel^.G;
     271                + Share * SrcPtr.Pixel^.G;
    272272              Screwed[xDst + dx, yDst + dy, 2] := Screwed[xDst + dx, yDst + dy, 2]
    273                 + share * SrcPtr.Pixel^.R;
     273                + Share * SrcPtr.Pixel^.R;
    274274              Screwed[xDst + dx, yDst + dy, 3] := Screwed[xDst + dx, yDst + dy,
    275                 3] + share;
     275                3] + Share;
    276276            end;
    277277        end;
     
    313313procedure TMessgExDlg.PaintEnemyArmy;
    314314var
    315   emix, ix, iy, X, Y, count, UnitsInLine: Integer;
     315  emix, ix, iy, X, Y, Count, UnitsInLine: Integer;
    316316begin
    317317  ix := 0;
     
    322322    UnitsInLine := nLostArmy;
    323323  for emix := 0 to MyRO.nEnemyModel - 1 do
    324     for count := 0 to LostArmy[emix] - 1 do
     324    for Count := 0 to LostArmy[emix] - 1 do
    325325    begin
    326326      X := Width div 2 + ix * 64 - UnitsInLine * 32;
     
    328328      with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do
    329329      begin
    330         BitBltCanvas(Canvas, X, Y, 64, 48, HGr.Mask.Canvas,
    331           pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND);
    332         BitBltCanvas(Canvas, X, Y, 64, 48, HGr.Data.Canvas,
    333           pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT);
     330        Sprite(Canvas, HGr, X, Y, 64, 48, pix mod 10 * 65 + 1, pix div 10 * 49 + 1);
    334331      end;
    335332
     
    401398        FrameImage(Canvas, BigImp, Width div 2 - 28, 24, xSizeBig,
    402399          ySizeBig, 0, 0);
    403         BitBltCanvas(Canvas, Width div 2 - 32, 20, 64, 44,
    404           HGr.Mask.Canvas, pix mod 10 * 65 + 1,
    405           pix div 10 * 49 + 1, SRCAND);
    406         BitBltCanvas(Canvas, Width div 2 - 32, 20, 64, 44,
    407           HGr.Data.Canvas, pix mod 10 * 65 + 1,
    408           pix div 10 * 49 + 1, SRCPAINT);
     400        Sprite(Canvas, HGr, Width div 2 - 32, 20, 64, 44, pix mod 10 * 65 + 1,
     401          pix div 10 * 49 + 1);
    409402      end;
    410403    mikBook:
Note: See TracChangeset for help on using the changeset viewer.