Changeset 496


Ignore:
Timestamp:
Dec 18, 2023, 10:31:54 PM (4 months ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
Location:
trunk
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/GameServer.pas

    r481 r496  
    610610procedure SaveGame(FileName: string; Auto: Boolean);
    611611var
    612   X, Y, I, zero, Tile, nLocal: Integer;
     612  X, Y, I, Zero, Tile, nLocal: Integer;
    613613  LogFile: TFileStream;
    614614  S: string[255];
     
    637637      fmCreate or fmShareExclusive);
    638638
    639   zero := 0;
     639  Zero := 0;
    640640  LogFile.Position := 0;
    641641  S := 'cEvoBook';
     
    662662  for I := 0 to nPl - 1 do
    663663    if not Assigned(bix[I]) then
    664       LogFile.Write(zero, 4)
     664      LogFile.Write(Zero, 4)
    665665    else
    666666    begin
     
    669669      else
    670670        S := PlayersBrain[I].FileName;
    671       Move(zero, S[Length(S) + 1], 4);
     671      Move(Zero, S[Length(S) + 1], 4);
    672672      LogFile.Write(S, (Length(S) div 4 + 1) * 4);
    673673      LogFile.Write(OriginalDataVersion[I], 4);
    674674      S := ''; { behavior }
    675       Move(zero, S[Length(S) + 1], 4);
     675      Move(Zero, S[Length(S) + 1], 4);
    676676      LogFile.Write(S, (Length(S) div 4 + 1) * 4);
    677677      LogFile.Write(Difficulty[I], 4);
     
    687687    AutoSaveState := CL.State;
    688688    AutoSaveExists := True;
    689   end
     689  end;
    690690end;
    691691
  • trunk/LocalPlayer/Battle.pas

    r471 r496  
    239239    FillRect(Rect(0, 0, ClientWidth, ClientHeight));
    240240    Brush.Style := TBrushStyle.bsClear;
    241     PaintBackground(self, 3 + Border, 3 + Border,
     241    PaintBackground(Self, 3 + Border, 3 + Border,
    242242      ClientWidth - (6 + 2 * Border), ClientHeight - (6 + 2 * Border));
    243243  end;
  • trunk/LocalPlayer/Enhance.pas

    r468 r496  
    126126procedure TEnhanceDlg.OffscreenPaint;
    127127var
    128   I, stage, TerrType, TileImp, X, EndStage, Cost, LastJob: Integer;
     128  I, Stage, TerrType, TileImp, X, EndStage, Cost, LastJob: Integer;
    129129  S: string;
    130   Done: set of jNone .. jTrans;
     130  Done: set of jNone..jTrans;
    131131  TypeChanged: Boolean;
    132132begin
    133   OffscreenUser := self;
     133  OffscreenUser := Self;
    134134  Offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    135135  FillOffscreen(0, 0, InnerWidth, InnerHeight);
     
    145145  Done := [];
    146146  Cost := 0;
    147   for stage := 0 to EndStage do
     147  for Stage := 0 to EndStage do
    148148  begin
    149     if stage > 0 then
     149    if Stage > 0 then
    150150    begin
    151151      Sprite(Offscreen, HGrSystem, X - 10, 66, 14, 14, 80, 1);
    152       case MyData.EnhancementJobs[Page, stage - 1] of
     152      case MyData.EnhancementJobs[Page, Stage - 1] of
    153153        jRoad:
    154154          begin
     
    192192          end;
    193193      end;
    194       Include(Done, MyData.EnhancementJobs[Page, stage - 1]);
     194      Include(Done, MyData.EnhancementJobs[Page, Stage - 1]);
    195195    end;
    196196
  • trunk/LocalPlayer/Help.pas

    r474 r496  
    402402    BitBltCanvas(ACanvas, X, Y - 4, 24, 24, HGrSystem.Data.Canvas, 1,
    403403      146);
    404     BiColorTextOut(ACanvas, $FFFFFF, $7F007F, X + 10 - ACanvas.Textwidth(S[1]) div 2,
     404    BiColorTextOut(ACanvas, $FFFFFF, $7F007F, X + 10 - ACanvas.TextWidth(S[1]) div 2,
    405405      Y - 3, S[1]);
    406406    BiColorTextOut(ACanvas, CaptionColor, $7F007F, X + 24, Y - 3, Copy(S, 2, 255));
     
    578578              Font.Assign(UniFont[ftSmall]);
    579579              BiColorTextOut(OffScreen.Canvas, $000000, $7F007F,
    580                 (InnerWidth - Textwidth(S)) div 2, I * 24 + 26, S);
     580                (InnerWidth - TextWidth(S)) div 2, I * 24 + 26, S);
    581581              Font.Assign(UniFont[ftNormal]);
    582582            end;
  • trunk/LocalPlayer/NatStat.pas

    r470 r496  
    498498      pView := Me;
    499499    Tag := pView;
    500     PlayerClick(self); // no, this is not nice
     500    PlayerClick(Self); // no, this is not nice
    501501  end
    502502  else
  • trunk/LocalPlayer/Nego.pas

    r474 r496  
    485485  OkEnabled: Boolean;
    486486begin
    487   if (OffscreenUser <> nil) and (OffscreenUser <> self) then
     487  if (OffscreenUser <> nil) and (OffscreenUser <> Self) then
    488488    OffscreenUser.Update;
    489489  // complete working with old owner to prevent rebound
    490   OffscreenUser := self;
     490  OffscreenUser := Self;
    491491
    492492  if (DipCommand >= 0) and (Page = History[Me].N) then
  • trunk/LocalPlayer/Rates.pas

    r468 r496  
    4848  S, s1: string;
    4949begin
    50   if (OffscreenUser <> nil) and (OffscreenUser <> self) then
     50  if (OffscreenUser <> nil) and (OffscreenUser <> Self) then
    5151    OffscreenUser.Update;
    5252  // complete working with old owner to prevent rebound
    53   OffscreenUser := self;
     53  OffscreenUser := Self;
    5454
    5555  Fill(Offscreen.Canvas, 0, 0, ClientWidth, ClientHeight,
  • trunk/LocalPlayer/Select.pas

    r487 r496  
    986986procedure TListDlg.InitLines;
    987987var
    988   required: array [0 .. nAdv - 1] of Integer;
     988  Required: array [0 .. nAdv - 1] of Integer;
    989989
    990990  procedure TryAddImpLine(Layer, Project: Integer);
     
    10001000  procedure SortTechs;
    10011001  var
    1002     I, J, swap: Integer;
     1002    I, J, Swap: Integer;
    10031003  begin // sort by advancedness
    10041004    for I := 0 to Lines[0] - 2 do
     
    10081008            nAdv + Code[0, J] then
    10091009          begin
    1010             swap := Code[0, I];
     1010            Swap := Code[0, I];
    10111011            Code[0, I] := Code[0, J];
    1012             Code[0, J] := swap;
     1012            Code[0, J] := Swap;
    10131013          end;
    10141014  end;
     
    10161016  procedure SortCities;
    10171017  var
    1018     I, J, swap: Integer;
     1018    I, J, Swap: Integer;
    10191019  begin
    10201020    for I := 0 to Lines[0] - 2 do
     
    10231023        then
    10241024        begin
    1025           swap := Code[0, I];
     1025          Swap := Code[0, I];
    10261026          Code[0, I] := Code[0, J];
    1027           Code[0, J] := swap;
     1027          Code[0, J] := Swap;
    10281028        end;
    10291029  end;
     
    10391039  procedure SortModels;
    10401040  var
    1041     I, J, swap: Integer;
     1041    I, J, Swap: Integer;
    10421042  begin // sort by code[2]
    10431043    for I := 0 to Lines[0] - 2 do
     
    10451045        if Code[2, I] > Code[2, J] then
    10461046        begin
    1047           swap := Code[0, I];
     1047          Swap := Code[0, I];
    10481048          Code[0, I] := Code[0, J];
    1049           Code[0, J] := swap;
    1050           swap := Code[1, I];
     1049          Code[0, J] := Swap;
     1050          Swap := Code[1, I];
    10511051          Code[1, I] := Code[1, J];
    1052           Code[1, J] := swap;
    1053           swap := Code[2, I];
     1052          Code[1, J] := Swap;
     1053          Swap := Code[2, I];
    10541054          Code[2, I] := Code[2, J];
    1055           Code[2, J] := swap;
     1055          Code[2, J] := Swap;
    10561056        end;
    10571057  end;
     
    10591059  procedure MarkPreqs(I: Integer);
    10601060  begin
    1061     required[I] := 1;
     1061    Required[I] := 1;
    10621062    if MyRO.Tech[I] < tsSeen then
    10631063    begin
     
    11471147        if MyData.FarTech <> adNone then
    11481148        begin
    1149           FillChar(required, SizeOf(required), 0);
     1149          FillChar(Required, SizeOf(Required), 0);
    11501150          MarkPreqs(MyData.FarTech);
    11511151        end;
     
    11531153          if ((I in FutureTech) or (MyRO.Tech[I] < tsApplicable)) and
    11541154            (Server(sSetResearch - sExecute, Me, I, nil^) >= rExecuted) and
    1155             ((MyData.FarTech = adNone) or (required[I] > 0)) then
     1155            ((MyData.FarTech = adNone) or (Required[I] > 0)) then
    11561156          begin
    11571157            Code[0, Lines[0]] := I;
  • trunk/LocalPlayer/TechTree.pas

    r468 r496  
    9999        ClientHeight - BlackBorder, -BlackBorder - xOffset,
    100100        -BlackBorder - yOffset, Paper);
    101     if xOffset + Image.width < ClientWidth - 2 * BlackBorder then
    102       FillRectSeamless(Canvas, BlackBorder + xOffset + Image.width, BlackBorder,
     101    if xOffset + Image.Width < ClientWidth - 2 * BlackBorder then
     102      FillRectSeamless(Canvas, BlackBorder + xOffset + Image.Width, BlackBorder,
    103103        ClientWidth - BlackBorder, ClientHeight - BlackBorder,
    104104        -BlackBorder - xOffset, -BlackBorder - yOffset, Paper);
    105105    X := Max(BlackBorder, BlackBorder + xOffset);
    106     W := Min(BlackBorder + xOffset + Image.width, ClientWidth - BlackBorder);
     106    W := Min(BlackBorder + xOffset + Image.Width, ClientWidth - BlackBorder);
    107107    if yOffset > 0 then
    108108      FillRectSeamless(Canvas, X, BlackBorder, W, BlackBorder + yOffset,
    109109        -BlackBorder - xOffset, -BlackBorder - yOffset, Paper);
    110     if yOffset + Image.height < ClientHeight - 2 * BlackBorder then
    111       FillRectSeamless(Canvas, X, BlackBorder + yOffset + Image.height, W,
     110    if yOffset + Image.Height < ClientHeight - 2 * BlackBorder then
     111      FillRectSeamless(Canvas, X, BlackBorder + yOffset + Image.Height, W,
    112112        ClientHeight - BlackBorder, -BlackBorder - xOffset,
    113113        -BlackBorder - yOffset, Paper);
     
    115115  BitBltCanvas(Canvas, Max(BlackBorder, BlackBorder + xOffset),
    116116    Max(BlackBorder, BlackBorder + yOffset),
    117     Min(Image.width, Min(Image.width + xOffset,
     117    Min(Image.Width, Min(Image.Width + xOffset,
    118118    Min(ClientWidth - 2 * BlackBorder, ClientWidth - 2 * BlackBorder - xOffset))
    119     ), Min(Image.height, Min(Image.height + yOffset,
     119    ), Min(Image.Height, Min(Image.Height + yOffset,
    120120    Min(ClientHeight - 2 * BlackBorder, ClientHeight - 2 * BlackBorder -
    121121    yOffset))), Image.Canvas, Max(0, -xOffset),
     
    177177    (Screen.Height - NewHeight) div 2,
    178178    NewWidth, NewHeight);
    179   CloseBtn.Left := width - CloseBtn.width - BlackBorder - 8;
     179  CloseBtn.Left := Width - CloseBtn.Width - BlackBorder - 8;
    180180  CloseBtn.Top := BlackBorder + 8;
    181181  xOffset := (ClientWidth - Image.Width + LeftBorder - RightBorder) div 2 -
     
    213213    if xOffset > LeftBorder then
    214214      xOffset := LeftBorder;
    215     if xOffset < ClientWidth - 2 * BlackBorder - Image.width - RightBorder then
    216       xOffset := ClientWidth - 2 * BlackBorder - Image.width - RightBorder;
     215    if xOffset < ClientWidth - 2 * BlackBorder - Image.Width - RightBorder then
     216      xOffset := ClientWidth - 2 * BlackBorder - Image.Width - RightBorder;
    217217    if yOffset > TopBorder then
    218218      yOffset := TopBorder;
    219     if yOffset < ClientHeight - 2 * BlackBorder - Image.height - BottomBorder
     219    if yOffset < ClientHeight - 2 * BlackBorder - Image.Height - BottomBorder
    220220    then
    221       yOffset := ClientHeight - 2 * BlackBorder - Image.height - BottomBorder;
     221      yOffset := ClientHeight - 2 * BlackBorder - Image.Height - BottomBorder;
    222222
    223223    SmartInvalidate;
  • trunk/LocalPlayer/Term.pas

    r486 r496  
    389389    procedure PaintLoc_BeforeMove(FromLoc: Integer);
    390390    procedure PaintLocTemp(Loc: Integer; Style: TPaintLocTempStyle = pltsNormal);
    391     procedure PaintBufferToScreen(xMap, yMap, width, height: Integer);
     391    procedure PaintBufferToScreen(xMap, yMap, Width, Height: Integer);
    392392    procedure PaintDestination;
    393393    procedure SetUnFocus(uix: Integer);
     
    652652  lxmax_xxx = 130;
    653653  LeftPanelWidth = 70;
    654   overlap = PanelHeight - MidPanelHeight;
     654  Overlap = PanelHeight - MidPanelHeight;
    655655  yTroop = PanelHeight - 83;
    656656  xPalace = 66;
     
    17901790    begin
    17911791      Brush.Color := $000000;
    1792       FillRect(Rect(0, 0, Panel.width, Panel.height));
     1792      FillRect(Rect(0, 0, Panel.Width, Panel.Height));
    17931793      Brush.Style := TBrushStyle.bsClear;
    17941794    end;
     
    17961796    begin
    17971797      Brush.Color := $000000;
    1798       FillRect(Rect(0, 0, TopBar.width, TopBar.height));
     1798      FillRect(Rect(0, 0, TopBar.Width, TopBar.Height));
    17991799      Brush.Style := TBrushStyle.bsClear;
    18001800    end;
     
    28062806        begin
    28072807          Brush.Color := $000000;
    2808           FillRect(Rect(0, 0, Panel.width, Panel.height));
     2808          FillRect(Rect(0, 0, Panel.Width, Panel.Height));
    28092809          Brush.Style := TBrushStyle.bsClear;
    28102810        end;
     
    28122812        begin
    28132813          Brush.Color := $000000;
    2814           FillRect(Rect(0, 0, TopBar.width, TopBar.height));
     2814          FillRect(Rect(0, 0, TopBar.Width, TopBar.Height));
    28152815          Brush.Style := TBrushStyle.bsClear;
    28162816        end;
     
    35653565  Buffer := TBitmap.Create;
    35663566  Buffer.PixelFormat := TPixelFormat.pf24bit;
    3567   if 2 * lxmax > 3 * xSizeBig then Buffer.width := 2 * lxmax
    3568     else Buffer.width := 3 * xSizeBig;
    3569   if lymax > 3 * ySizeBig then Buffer.height := lymax
    3570     else Buffer.height := 3 * ySizeBig;
     3567  if 2 * lxmax > 3 * xSizeBig then Buffer.Width := 2 * lxmax
     3568    else Buffer.Width := 3 * xSizeBig;
     3569  if lymax > 3 * ySizeBig then Buffer.Height := lymax
     3570    else Buffer.Height := 3 * ySizeBig;
    35713571  Buffer.Canvas.Font.Assign(UniFont[ftSmall]);
    35723572  for I := 0 to nPl - 1 do
     
    42084208      MapOffset := (ClientWidth - MapWidth) div 2;
    42094209    end;
    4210     MapHeight := ClientHeight - TopBarHeight - PanelHeight + overlap;
     4210    MapHeight := ClientHeight - TopBarHeight - PanelHeight + Overlap;
    42114211    Panel.SetSize(ClientWidth, PanelHeight);
    42124212    TopBar.SetSize(ClientWidth, TopBarHeight);
     
    42684268  ResearchArea.Left := ClientWidth div 2;
    42694269  ManagementArea.Left := ClientWidth - xPalace;
    4270   ManagementArea.Top := TopBarHeight + MapHeight - overlap + yPalace;
     4270  ManagementArea.Top := TopBarHeight + MapHeight - Overlap + yPalace;
    42714271  ArrangeMidPanel;
    42724272  if RepaintOnResize then
     
    46484648// panel protusions are added
    46494649// NoMap must be set to buffer and bounds before
    4650 procedure TMainScreen.PaintBufferToScreen(xMap, yMap, width, height: Integer);
    4651 begin
    4652   if xMap + width > MapWidth then
    4653     width := MapWidth - xMap;
    4654   if yMap + height > MapHeight then
    4655     height := MapHeight - yMap;
    4656   if (width <= 0) or (height <= 0) or (width + xMap <= 0) or (height + yMap <= 0)
     4650procedure TMainScreen.PaintBufferToScreen(xMap, yMap, Width, Height: Integer);
     4651begin
     4652  if xMap + Width > MapWidth then
     4653    Width := MapWidth - xMap;
     4654  if yMap + Height > MapHeight then
     4655    Height := MapHeight - yMap;
     4656  if (Width <= 0) or (Height <= 0) or (Width + xMap <= 0) or (Height + yMap <= 0)
    46574657  then
    46584658    Exit;
    46594659
    4660   NoMap.BitBltBitmap(Panel, -xMap - MapOffset, -yMap + MapHeight - overlap, xMidPanel,
    4661     overlap, 0, 0, SRCCOPY);
     4660  NoMap.BitBltBitmap(Panel, -xMap - MapOffset, -yMap + MapHeight - Overlap, xMidPanel,
     4661    Overlap, 0, 0, SRCCOPY);
    46624662  NoMap.BitBltBitmap(Panel, -xMap - MapOffset + xRightPanel,
    4663     -yMap + MapHeight - overlap, Panel.width - xRightPanel, overlap,
     4663    -yMap + MapHeight - Overlap, Panel.Width - xRightPanel, Overlap,
    46644664    xRightPanel, 0, SRCCOPY);
    46654665  if yMap < 0 then
    46664666  begin
    46674667    if xMap < 0 then
    4668       BitBltCanvas(Canvas, MapOffset, TopBarHeight, width + xMap,
    4669         height + yMap, Buffer.Canvas, -xMap, -yMap)
     4668      BitBltCanvas(Canvas, MapOffset, TopBarHeight, Width + xMap,
     4669        Height + yMap, Buffer.Canvas, -xMap, -yMap)
    46704670    else
    4671       BitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight, width,
    4672         height + yMap, Buffer.Canvas, 0, -yMap);
     4671      BitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight, Width,
     4672        Height + yMap, Buffer.Canvas, 0, -yMap);
    46734673  end
    46744674  else
    46754675  begin
    46764676    if xMap < 0 then
    4677       BitBltCanvas(Canvas, MapOffset, TopBarHeight + yMap, width + xMap,
    4678         height, Buffer.Canvas, -xMap, 0)
     4677      BitBltCanvas(Canvas, MapOffset, TopBarHeight + yMap, Width + xMap,
     4678        Height, Buffer.Canvas, -xMap, 0)
    46794679    else
    4680       BitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight + yMap, width,
    4681         height, Buffer.Canvas, 0, 0);
     4680      BitBltCanvas(Canvas, xMap + MapOffset, TopBarHeight + yMap, Width,
     4681        Height, Buffer.Canvas, 0, 0);
    46824682  end;
    46834683end;
     
    47294729      FillRect(Rect(0, 0, MapWidth, MapHeight));
    47304730      Brush.Style := TBrushStyle.bsClear;
    4731       OffscreenUser := self;
     4731      OffscreenUser := Self;
    47324732      Exit;
    47334733    end;
    47344734
    47354735  MainMap.SetPaintBounds(0, 0, MapWidth, MapHeight);
    4736   if OffscreenUser <> self then
     4736  if OffscreenUser <> Self then
    47374737  begin
    47384738    if OffscreenUser <> nil then
     
    47724772      for DoInvalidate := False to FastScrolling do begin
    47734773        if DoInvalidate then begin
    4774           rec.Bottom := MapHeight - overlap;
     4774          rec.Bottom := MapHeight - Overlap;
    47754775{$IFDEF WINDOWS}
    47764776          ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
     
    47954795        else if yw > ywd then begin
    47964796          if DoInvalidate then
    4797             RectInvalidate(MapOffset, TopBarHeight + MapHeight - overlap -
     4797            RectInvalidate(MapOffset, TopBarHeight + MapHeight - Overlap -
    47984798              (yw - ywd) * yyt, MapOffset + MapWidth, TopBarHeight + MapHeight
    4799               - overlap)
     4799              - Overlap)
    48004800          else
    48014801            ProcessRect(xw, (ywd + MapHeight div (yyt * 2) * 2), MapWidth div xxt,
     
    48184818      if not FastScrolling then
    48194819        RectInvalidate(MapOffset, TopBarHeight, MapOffset + MapWidth,
    4820           TopBarHeight + MapHeight - overlap);
    4821       RectInvalidate(xMidPanel, TopBarHeight + MapHeight - overlap, xRightPanel,
     4820          TopBarHeight + MapHeight - Overlap);
     4821      RectInvalidate(xMidPanel, TopBarHeight + MapHeight - Overlap, xRightPanel,
    48224822        TopBarHeight + MapHeight);
    48234823    end;
     
    48524852  MiniMapPaint;
    48534853  CopyMiniToPanel;
    4854   RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2,
    4855     xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - overlap + yMini +
     4854  RectInvalidate(xMini + 2, TopBarHeight + MapHeight - Overlap + yMini + 2,
     4855    xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - Overlap + yMini +
    48564856    2 + G.ly);
    48574857end;
     
    49084908    Fill(Panel.Canvas, 0, 3, xMidPanel + 7 - 10, PanelHeight - 3,
    49094909      MainTexture.Width - (xMidPanel + 7 - 10), MainTexture.Height - PanelHeight);
    4910     Fill(Panel.Canvas, xRightPanel + 10 - 7, 3, Panel.width - xRightPanel - 10 +
     4910    Fill(Panel.Canvas, xRightPanel + 10 - 7, 3, Panel.Width - xRightPanel - 10 +
    49114911      7, PanelHeight - 3, -(xRightPanel + 10 - 7), MainTexture.Height - PanelHeight);
    49124912    FillLarge(Panel.Canvas, xMidPanel - 2, PanelHeight - MidPanelHeight,
     
    53375337      if TerrainBtn.Visible then
    53385338        with TerrainBtn do
    5339           RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    5340             (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
     5339          RFrame(Panel.Canvas, Left - 1, Top - Self.ClientHeight +
     5340            (PanelHeight - 1), Left + Width, Top + Height - Self.ClientHeight +
    53415341            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight)
    53425342    end; { if TroopLoc>=0 }
     
    53495349        if Visible then
    53505350        begin
    5351           Dump(Panel, HGrSystem, Left, Top - self.ClientHeight + PanelHeight,
     5351          Dump(Panel, HGrSystem, Left, Top - Self.ClientHeight + PanelHeight,
    53525352            25, 25, 169, 243);
    5353           Sprite(Panel, HGrSystem, Left, Top - self.ClientHeight + PanelHeight,
     5353          Sprite(Panel, HGrSystem, Left, Top - Self.ClientHeight + PanelHeight,
    53545354            25, 25, 1 + 26 * ButtonIndex, 337);
    5355           RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    5356             (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
     5355          RFrame(Panel.Canvas, Left - 1, Top - Self.ClientHeight +
     5356            (PanelHeight - 1), Left + Width, Top + Height - Self.ClientHeight +
    53575357            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    53585358        end;
     
    53655365        with TButtonC(Controls[I]) do
    53665366        begin
    5367           Dump(Panel, HGrSystem, Left, Top - self.ClientHeight + PanelHeight,
     5367          Dump(Panel, HGrSystem, Left, Top - Self.ClientHeight + PanelHeight,
    53685368            12, 12, 169, 178 + 13 * ButtonIndex);
    5369           RFrame(Panel.Canvas, Left - 1, Top - self.ClientHeight +
    5370             (PanelHeight - 1), Left + width, Top + height - self.ClientHeight +
     5369          RFrame(Panel.Canvas, Left - 1, Top - Self.ClientHeight +
     5370            (PanelHeight - 1), Left + Width, Top + Height - Self.ClientHeight +
    53715371            PanelHeight, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    53725372        end;
     
    56205620  MiniMapPaint;
    56215621  CopyMiniToPanel;
    5622   RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2,
    5623     xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - overlap + yMini +
     5622  RectInvalidate(xMini + 2, TopBarHeight + MapHeight - Overlap + yMini + 2,
     5623    xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - Overlap + yMini +
    56245624    2 + G.ly);
    56255625  Update;
     
    58465846            MainTexture.ColorMark);
    58475847      end;
    5848       RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2,
    5849         xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - overlap + yMini
     5848      RectInvalidate(xMini + 2, TopBarHeight + MapHeight - Overlap + yMini + 2,
     5849        xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - Overlap + yMini
    58505850        + 2 + G.ly);
    58515851    end
     
    60296029      BattleDlg.uix := UnFocus;
    60306030      BattleDlg.ToLoc := MouseLoc;
    6031       BattleDlg.Left := X - BattleDlg.width div 2;
     6031      BattleDlg.Left := X - BattleDlg.Width div 2;
    60326032      if BattleDlg.Left < 0 then
    60336033        BattleDlg.Left := 0
    6034       else if BattleDlg.Left + BattleDlg.width > Screen.width then
    6035         BattleDlg.Left := Screen.width - BattleDlg.width;
    6036       BattleDlg.Top := Y - BattleDlg.height div 2;
     6034      else if BattleDlg.Left + BattleDlg.Width > Screen.Width then
     6035        BattleDlg.Left := Screen.Width - BattleDlg.Width;
     6036      BattleDlg.Top := Y - BattleDlg.Height div 2;
    60376037      if BattleDlg.Top < 0 then
    60386038        BattleDlg.Top := 0
    6039       else if BattleDlg.Top + BattleDlg.height > Screen.height then
    6040         BattleDlg.Top := Screen.height - BattleDlg.height;
     6039      else if BattleDlg.Top + BattleDlg.Height > Screen.Height then
     6040        BattleDlg.Top := Screen.Height - BattleDlg.Height;
    60416041      BattleDlg.IsSuicideQuery := False;
    60426042      BattleDlg.Show;
     
    78417841        Buffer.Canvas, 0, 0);
    78427842      MainOffscreenPaint;
    7843       RectInvalidate(xMini + 2, TopBarHeight + MapHeight - overlap + yMini + 2,
    7844         xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - overlap + yMini +
     7843      RectInvalidate(xMini + 2, TopBarHeight + MapHeight - Overlap + yMini + 2,
     7844        xMini + 2 + G.lx * 2, TopBarHeight + MapHeight - Overlap + yMini +
    78457845        2 + G.ly);
    78467846      Update;
     
    79707970      if xMidPanel > MapOffset then
    79717971        FillRect(Rect(0, TopBarHeight, MapOffset, TopBarHeight + MapHeight
    7972           - overlap))
     7972          - Overlap))
    79737973      else
    79747974      begin
    79757975        FillRect(Rect(0, TopBarHeight, xMidPanel, TopBarHeight + MapHeight -
    7976           overlap));
     7976          Overlap));
    79777977        FillRect(Rect(xMidPanel, TopBarHeight, MapOffset,
    79787978          TopBarHeight + MapHeight));
     
    79807980      if xRightPanel < MapOffset + MapWidth then
    79817981        FillRect(Rect(MapOffset + MapWidth, TopBarHeight, ClientWidth,
    7982           TopBarHeight + MapHeight - overlap))
     7982          TopBarHeight + MapHeight - Overlap))
    79837983      else
    79847984      begin
     
    79867986          TopBarHeight + MapHeight));
    79877987        FillRect(Rect(xRightPanel, TopBarHeight, ClientWidth,
    7988           TopBarHeight + MapHeight - overlap));
     7988          TopBarHeight + MapHeight - Overlap));
    79897989      end;
    79907990      Brush.Style := TBrushStyle.bsClear;
    79917991    end;
    7992   BitBltCanvas(Canvas, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap,
     7992  BitBltCanvas(Canvas, MapOffset, TopBarHeight, MapWidth, MapHeight - Overlap,
    79937993    Offscreen.Canvas, 0, 0);
    79947994  BitBltCanvas(Canvas, 0, 0, ClientWidth, TopBarHeight, TopBar.Canvas,
    79957995    0, 0);
    79967996  if xMidPanel > MapOffset then
    7997     BitBltCanvas(Canvas, xMidPanel, TopBarHeight + MapHeight - overlap,
    7998       ClientWidth div 2 - xMidPanel, overlap, Offscreen.Canvas,
    7999       xMidPanel - MapOffset, MapHeight - overlap)
     7997    BitBltCanvas(Canvas, xMidPanel, TopBarHeight + MapHeight - Overlap,
     7998      ClientWidth div 2 - xMidPanel, Overlap, Offscreen.Canvas,
     7999      xMidPanel - MapOffset, MapHeight - Overlap)
    80008000  else
    8001     BitBltCanvas(Canvas, MapOffset, TopBarHeight + MapHeight - overlap,
    8002       ClientWidth div 2 - MapOffset, overlap, Offscreen.Canvas, 0,
    8003       MapHeight - overlap);
     8001    BitBltCanvas(Canvas, MapOffset, TopBarHeight + MapHeight - Overlap,
     8002      ClientWidth div 2 - MapOffset, Overlap, Offscreen.Canvas, 0,
     8003      MapHeight - Overlap);
    80048004  if xRightPanel < MapOffset + MapWidth then
    8005     BitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
    8006       xRightPanel - ClientWidth div 2, overlap, Offscreen.Canvas,
    8007       ClientWidth div 2 - MapOffset, MapHeight - overlap)
     8005    BitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - Overlap,
     8006      xRightPanel - ClientWidth div 2, Overlap, Offscreen.Canvas,
     8007      ClientWidth div 2 - MapOffset, MapHeight - Overlap)
    80088008  else
    8009     BitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
    8010       MapOffset + MapWidth - ClientWidth div 2, overlap,
     8009    BitBltCanvas(Canvas, ClientWidth div 2, TopBarHeight + MapHeight - Overlap,
     8010      MapOffset + MapWidth - ClientWidth div 2, Overlap,
    80118011      Offscreen.Canvas, ClientWidth div 2 - MapOffset,
    8012       MapHeight - overlap);
    8013   BitBltCanvas(Canvas, 0, TopBarHeight + MapHeight - overlap, xMidPanel,
    8014     overlap, Panel.Canvas, 0, 0);
    8015   BitBltCanvas(Canvas, xRightPanel, TopBarHeight + MapHeight - overlap,
    8016     Panel.width - xRightPanel, overlap, Panel.Canvas, xRightPanel, 0);
    8017   BitBltCanvas(Canvas, 0, TopBarHeight + MapHeight, Panel.width,
    8018     PanelHeight - overlap, Panel.Canvas, 0, overlap);
     8012      MapHeight - Overlap);
     8013  BitBltCanvas(Canvas, 0, TopBarHeight + MapHeight - Overlap, xMidPanel,
     8014    Overlap, Panel.Canvas, 0, 0);
     8015  BitBltCanvas(Canvas, xRightPanel, TopBarHeight + MapHeight - Overlap,
     8016    Panel.Width - xRightPanel, Overlap, Panel.Canvas, xRightPanel, 0);
     8017  BitBltCanvas(Canvas, 0, TopBarHeight + MapHeight, Panel.Width,
     8018    PanelHeight - Overlap, Panel.Canvas, 0, Overlap);
    80198019  if (pLogo >= 0) and (G.RO[pLogo] = nil) and (AILogo[pLogo] <> nil) then
    80208020    BitBltCanvas(Canvas, xRightPanel + 10 - (16 + 64),
  • trunk/MiniMap.pas

    r488 r496  
    121121  if LoadGraphicFile(Bitmap, ImageFileName, [gfNoError]) then
    122122  begin
    123     if Bitmap.width div 2 > MaxWidthMapLogo then
    124       Bitmap.width := MaxWidthMapLogo * 2;
    125     if Bitmap.height > MaxHeightMapLogo then
    126       Bitmap.height := MaxHeightMapLogo;
    127     Size.X := Bitmap.width div 2;
    128     Size.Y := Bitmap.height;
     123    if Bitmap.Width div 2 > MaxWidthMapLogo then
     124      Bitmap.Width := MaxWidthMapLogo * 2;
     125    if Bitmap.Height > MaxHeightMapLogo then
     126      Bitmap.Height := MaxHeightMapLogo;
     127    Size.X := Bitmap.Width div 2;
     128    Size.Y := Bitmap.Height;
    129129  end else begin
    130130    Mode := mmNone;
  • trunk/Packages/CevoComponents/BaseWin.pas

    r472 r496  
    175175    Assert((NewMode = wmModal) or (FWindowMode <> wmModal));
    176176    // don't make modal window non-modal
    177     if (NewMode = wmModal) and (forceclose or (FWindowMode <> wmModal)) then
     177    if (NewMode = wmModal) and (ForceClose or (FWindowMode <> wmModal)) then
    178178    begin // make modal
    179179      UserLeft := Left;
     
    183183      ShowModal;
    184184    end
    185     else if forceclose then
     185    else if ForceClose then
    186186    begin // make modal
    187187      Visible := False;
  • trunk/Packages/CevoComponents/ButtonBase.pas

    r471 r496  
    8484      Invalidate;
    8585      if @DownChangedProc <> nil then
    86         DownChangedProc(self);
     86        DownChangedProc(Self);
    8787    end;
    8888    if (Button = TMouseButton.mbLeft) and (@ClickProc <> nil) then
    89       ClickProc(self);
     89      ClickProc(Self);
    9090  end
    9191  else
     
    9898      Invalidate;
    9999      if @DownChangedProc <> nil then
    100         DownChangedProc(self);
     100        DownChangedProc(Self);
    101101    end;
    102102  end;
     
    113113        Paint;
    114114        if @DownChangedProc <> nil then
    115           DownChangedProc(self);
     115          DownChangedProc(Self);
    116116      end
    117117      else
     
    122122      Paint;
    123123      if @DownChangedProc <> nil then
    124         DownChangedProc(self);
     124        DownChangedProc(Self);
    125125    end;
    126126end;
  • trunk/Packages/DpiControls/Dpi.Forms.pas

    r495 r496  
    1414  TMessageEvent = procedure (var TheMessage : TLMessage) of object;
    1515  TCloseAction = Forms.TCloseAction;
     16  TFormState = Forms.TFormState;
    1617  TFormStateType = Forms.TFormStateType;
    1718  TWindowState = Forms.TWindowState;
  • trunk/Start.pas

    r479 r496  
    264264  for I := 0 to PlayerSlots.Count - 1 do
    265265  with PlayerSlots[I] do begin
    266     DiffUpBtn := TButtonC.Create(self);
     266    DiffUpBtn := TButtonC.Create(Self);
    267267    DiffUpBtn.Graphic := HGrSystem.Data;
    268     DiffUpBtn.left := xBrain[I] - 18;
    269     DiffUpBtn.top := yBrain[I] + 39;
     268    DiffUpBtn.Left := xBrain[I] - 18;
     269    DiffUpBtn.Top := yBrain[I] + 39;
    270270    DiffUpBtn.ButtonIndex := 1;
    271     DiffUpBtn.Parent := self;
     271    DiffUpBtn.Parent := Self;
    272272    DiffUpBtn.OnClick := DiffBtnClick;
    273     DiffDownBtn := TButtonC.Create(self);
     273    DiffDownBtn := TButtonC.Create(Self);
    274274    DiffDownBtn.Graphic := HGrSystem.Data;
    275     DiffDownBtn.left := xBrain[I] - 18;
    276     DiffDownBtn.top := yBrain[I] + 51;
     275    DiffDownBtn.Left := xBrain[I] - 18;
     276    DiffDownBtn.Top := yBrain[I] + 51;
    277277    DiffDownBtn.ButtonIndex := 0;
    278     DiffDownBtn.Parent := self;
     278    DiffDownBtn.Parent := Self;
    279279    DiffDownBtn.OnClick := DiffBtnClick;
    280280  end;
    281281  for I := 6 to 8 do
    282282  with PlayerSlots[I] do begin
    283     MultiBtn := TButtonC.Create(self);
     283    MultiBtn := TButtonC.Create(Self);
    284284    MultiBtn.Graphic := HGrSystem.Data;
    285     MultiBtn.left := xBrain[I] - 18;
    286     MultiBtn.top := yBrain[I];
    287     MultiBtn.Parent := self;
     285    MultiBtn.Left := xBrain[I] - 18;
     286    MultiBtn.Top := yBrain[I];
     287    MultiBtn.Parent := Self;
    288288    MultiBtn.OnClick := MultiBtnClick;
    289289    OfferMultiple := True;
     
    291291
    292292  X := BiColorTextWidth(Canvas, Phrases.Lookup('STARTCONTROLS', 7)) div 2;
    293   CustomizeBtn.left := x0Brain + 32 - 16 - X;
     293  CustomizeBtn.Left := x0Brain + 32 - 16 - X;
    294294  if AutoDiff < 0 then
    295295    CustomizeBtn.ButtonIndex := 3
     
    352352    begin
    353353      with Controls[I].BoundsRect do
    354         r1 := CreateRectRgn(left, top, Right, Bottom);
     354        r1 := CreateRectRgn(Left, Top, Right, Bottom);
    355355      CombineRgn(r0, r0, r1, RGN_DIFF);
    356356      DeleteObject(r1);
     
    619619  if Tab = tbMain then
    620620  begin
    621     PaintBackground(self, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4);
     621    PaintBackground(Self, 3, TabHeight - 1, TabSize - 4 - 3 + TabOffset + 3, 4);
    622622    Canvas.Pixels[2, TabHeight] := MainTexture.ColorBevelLight;
    623623  end
    624624  else
    625625  begin
    626     PaintBackground(self, TabOffset + 3 + Integer(Tab) * TabSize, TabHeight - 1,
     626    PaintBackground(Self, TabOffset + 3 + Integer(Tab) * TabSize, TabHeight - 1,
    627627      TabSize - 4, 4);
    628628    Canvas.Pixels[TabOffset + Integer(Tab) * TabSize + 2, TabHeight] :=
     
    738738            Frame(Canvas, xBrain[I] - 19, yBrain[I] + 18, xBrain[I] - 18 + 12,
    739739              yBrain[I] + (19 + 14), $000000, $000000);
    740             RFrame(Canvas, PlayerSlots[I].DiffUpBtn.left - 1, PlayerSlots[I].DiffUpBtn.top - 1,
    741               PlayerSlots[I].DiffUpBtn.left + 12, PlayerSlots[I].DiffUpBtn.top + 24,
     740            RFrame(Canvas, PlayerSlots[I].DiffUpBtn.Left - 1, PlayerSlots[I].DiffUpBtn.Top - 1,
     741              PlayerSlots[I].DiffUpBtn.Left + 12, PlayerSlots[I].DiffUpBtn.Top + 24,
    742742              MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    743743            with Canvas do
     
    750750            if PlayerSlots[I].OfferMultiple then
    751751            begin
    752               RFrame(Canvas, PlayerSlots[I].MultiBtn.left - 1, PlayerSlots[I].MultiBtn.top - 1,
    753                 PlayerSlots[I].MultiBtn.left + 12, PlayerSlots[I].MultiBtn.top + 12,
     752              RFrame(Canvas, PlayerSlots[I].MultiBtn.Left - 1, PlayerSlots[I].MultiBtn.Top - 1,
     753                PlayerSlots[I].MultiBtn.Left + 12, PlayerSlots[I].MultiBtn.Top + 12,
    754754                MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    755755              BitBltCanvas(Canvas, xBrain[I] - 31, yBrain[I], 13, 12,
     
    850850    BtnFrame(Canvas, StartBtn.BoundsRect, MainTexture);
    851851  if Up2Btn.Visible then
    852     RFrame(Canvas, Up2Btn.left - 1, Up2Btn.top - 1, Up2Btn.left + 12,
    853       Up2Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
     852    RFrame(Canvas, Up2Btn.Left - 1, Up2Btn.Top - 1, Up2Btn.Left + 12,
     853      Up2Btn.Top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    854854  if Up1Btn.Visible then
    855     RFrame(Canvas, Up1Btn.left - 1, Up1Btn.top - 1, Up1Btn.left + 12,
    856       Up1Btn.top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
     855    RFrame(Canvas, Up1Btn.Left - 1, Up1Btn.Top - 1, Up1Btn.Left + 12,
     856      Up1Btn.Top + 24, MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    857857  if AutoDiffUpBtn.Visible then
    858     RFrame(Canvas, AutoDiffUpBtn.left - 1, AutoDiffUpBtn.top - 1,
    859       AutoDiffUpBtn.left + 12, AutoDiffUpBtn.top + 24, MainTexture.ColorBevelShade,
     858    RFrame(Canvas, AutoDiffUpBtn.Left - 1, AutoDiffUpBtn.Top - 1,
     859      AutoDiffUpBtn.Left + 12, AutoDiffUpBtn.Top + 24, MainTexture.ColorBevelShade,
    860860      MainTexture.ColorBevelLight);
    861861  if AutoEnemyUpBtn.Visible then
    862     RFrame(Canvas, AutoEnemyUpBtn.left - 1, AutoEnemyUpBtn.top - 1,
    863       AutoEnemyUpBtn.left + 12, AutoEnemyUpBtn.top + 24,
     862    RFrame(Canvas, AutoEnemyUpBtn.Left - 1, AutoEnemyUpBtn.Top - 1,
     863      AutoEnemyUpBtn.Left + 12, AutoEnemyUpBtn.Top + 24,
    864864      MainTexture.ColorBevelShade, MainTexture.ColorBevelLight);
    865865  if CustomizeBtn.Visible then
    866     RFrame(Canvas, CustomizeBtn.left - 1, CustomizeBtn.top - 1,
    867       CustomizeBtn.left + 12, CustomizeBtn.top + 12, MainTexture.ColorBevelShade,
     866    RFrame(Canvas, CustomizeBtn.Left - 1, CustomizeBtn.Top - 1,
     867      CustomizeBtn.Left + 12, CustomizeBtn.Top + 12, MainTexture.ColorBevelShade,
    868868      MainTexture.ColorBevelLight);
    869869  if List.Visible then
     
    11761176            end;
    11771177            SmartInvalidate(xBrain[I] - 31, yBrain[I] - 1, xBrain[I] + 64,
    1178               PlayerSlots[I].DiffUpBtn.top + 25);
     1178              PlayerSlots[I].DiffUpBtn.Top + 25);
    11791179          end;
    11801180        BrainTerm.Flags := BrainTerm.Flags and not fUsed;
     
    11821182    end;
    11831183    SmartInvalidate(xBrain[PlayerPopupIndex] - 31, yBrain[PlayerPopupIndex] - 1,
    1184       xBrain[PlayerPopupIndex] + 64, PlayerSlots[PlayerPopupIndex].DiffUpBtn.top + 25);
     1184      xBrain[PlayerPopupIndex] + 64, PlayerSlots[PlayerPopupIndex].DiffUpBtn.Top + 25);
    11851185  end;
    11861186end;
     
    15071507        InitPopup(I);
    15081508        if yBrain[I] > y0Brain then
    1509           PopupMenu1.Popup(left + xBrain[I] + 4, top + yBrain[I] + 60)
     1509          PopupMenu1.Popup(Left + xBrain[I] + 4, Top + yBrain[I] + 60)
    15101510        else
    1511           PopupMenu1.Popup(left + xBrain[I] + 4, top + yBrain[I] + 4);
     1511          PopupMenu1.Popup(Left + xBrain[I] + 4, Top + yBrain[I] + 4);
    15121512      end;
    15131513  end
     
    15201520    begin
    15211521      InitPopup(-1);
    1522       PopupMenu1.Popup(left + xDefault + 4, top + yDefault + 4);
     1522      PopupMenu1.Popup(Left + xDefault + 4, Top + yDefault + 4);
    15231523    end
    15241524  else if (Page = pgLoad) and (LastTurn > 0) and (Y >= yTurnSlider) and
Note: See TracChangeset for help on using the changeset viewer.