Changeset 324


Ignore:
Timestamp:
Mar 23, 2021, 3:09:11 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk/LocalPlayer
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/CityScreen.pas

    r323 r324  
    17321732  end; }
    17331733
    1734 var
    1735   i, j, k: integer;
    1736 
    17371734procedure TCityDlg.PageUpBtnClick(Sender: TObject);
    17381735begin
     
    17711768end;
    17721769
     1770procedure SortImprovements;
     1771var
     1772  i, j, k: integer;
     1773begin
     1774  for i := 0 to nImp - 1 do
     1775    ImpSorted[i] := i;
     1776  for i := 0 to nImp - 2 do
     1777    for j := i + 1 to nImp - 1 do
     1778      if Prio(ImpSorted[i]) > Prio(ImpSorted[j]) then begin
     1779        k := ImpSorted[i];
     1780        ImpSorted[i] := ImpSorted[j];
     1781        ImpSorted[j] := k;
     1782      end;
     1783end;
     1784
    17731785initialization
    17741786
    1775 for i := 0 to nImp - 1 do
    1776   ImpSorted[i] := i;
    1777 for i := 0 to nImp - 2 do
    1778   for j := i + 1 to nImp - 1 do
    1779     if Prio(ImpSorted[i]) > Prio(ImpSorted[j]) then
    1780     begin
    1781       k := ImpSorted[i];
    1782       ImpSorted[i] := ImpSorted[j];
    1783       ImpSorted[j] := k;
    1784     end;
     1787SortImprovements;
    17851788
    17861789end.
  • trunk/LocalPlayer/IsoEngine.pas

    r322 r324  
    1414
    1515  TIsoMap = class
    16     constructor Create;
    17     procedure SetOutput(Output: TBitmap);
    18     procedure SetPaintBounds(Left, Top, Right, Bottom: integer);
    19     procedure Paint(x, y, Loc, nx, ny, CityLoc, CityOwner: integer;
    20       UseBlink: boolean = false; CityAllowClick: boolean = false);
    21     procedure PaintUnit(x, y: integer; const UnitInfo: TUnitInfo;
    22       Status: integer);
    23     procedure PaintCity(x, y: integer; const CityInfo: TCityInfo;
    24       accessory: boolean = true);
    25     procedure BitBltBitmap(Src: TBitmap; x, y, Width, Height, xSrc, ySrc,
    26       Rop: integer);
    27 
    28     procedure AttackBegin(const ShowMove: TShowMove);
    29     procedure AttackEffect(const ShowMove: TShowMove);
    30     procedure AttackEnd;
    31 
    3216  private
    3317    procedure CityGrid(xm, ym: integer; CityAllowClick: Boolean);
     
    3721  protected
    3822    FOutput: TBitmap;
    39     FLeft, FTop, FRight, FBottom, RealTop, RealBottom, AttLoc, DefLoc,
    40       DefHealth, FAdviceLoc: integer;
     23    FLeft: Integer;
     24    FTop: Integer;
     25    FRight: Integer;
     26    FBottom: Integer;
     27    RealTop: Integer;
     28    RealBottom: Integer;
     29    AttLoc: Integer;
     30    DefLoc: Integer;
     31    DefHealth: Integer;
     32    FAdviceLoc: Integer;
    4133    DataCanvas: TCanvas;
    4234    MaskCanvas: TCanvas;
     
    5345    procedure Sprite(HGr: TGraphicSet; xDst, yDst, Width, Height, xGr, yGr: integer);
    5446    procedure TSprite(xDst, yDst, grix: integer; PureBlack: boolean = false);
    55 
    5647  public
     48    constructor Create;
     49    procedure SetOutput(Output: TBitmap);
     50    procedure SetPaintBounds(Left, Top, Right, Bottom: integer);
     51    procedure Paint(x, y, Loc, nx, ny, CityLoc, CityOwner: integer;
     52      UseBlink: boolean = false; CityAllowClick: boolean = false);
     53    procedure PaintUnit(x, y: integer; const UnitInfo: TUnitInfo;
     54      Status: integer);
     55    procedure PaintCity(x, y: integer; const CityInfo: TCityInfo;
     56      accessory: boolean = true);
     57    procedure BitBltBitmap(Src: TBitmap; x, y, Width, Height, xSrc, ySrc,
     58      Rop: integer);
     59    procedure AttackBegin(const ShowMove: TShowMove);
     60    procedure AttackEffect(const ShowMove: TShowMove);
     61    procedure AttackEnd;
    5762    property AdviceLoc: integer read FAdviceLoc write FAdviceLoc;
    5863  end;
     
    10361041        if BordersOK and (1 shl p1) = 0 then
    10371042        begin
    1038           // Clearing before BitBltBitmap SRCCOPY shouldn't be neccesary but for some
    1039           // reason without it code works different then under Delphi
    1040           Borders.Canvas.FillRect(Bounds(0, p1 * (yyt * 2), xxt * 2, yyt * 2));
    1041 
     1043          UnshareBitmap(Borders);
    10421044          BitBltCanvas(Borders.Canvas, 0, p1 * (yyt * 2), xxt * 2,
    10431045            yyt * 2, HGrTerrain.Data.Canvas,
Note: See TracChangeset for help on using the changeset viewer.