Ignore:
Timestamp:
Dec 3, 2023, 11:28:08 AM (5 months ago)
Author:
chronos
Message:
  • Added: High DPI support integrated into trunk branch. It can be enabled by adding DPI define to compiler parameters for main project and packages.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r462 r468  
    1212{$ENDIF}
    1313  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    14   LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, DrawDlg, Types,
    15   Forms, Menus, ExtCtrls, dateutils, Platform, ButtonB, ButtonC, EOTButton, Area,
     14  LCLIntf, LCLType, SysUtils, Classes, DrawDlg, Types, System.UITypes,
     15  DateUtils, Platform, ButtonB, ButtonC, EOTButton, Area,
    1616  GraphicSet, MiniMap, IsoEngine, Wonders, TechTree, Enhance, Nego, CityType,
    1717  Diagram, CityScreen, Rates, Battle, NatStat, UnitStat, Draft, Select, MessgEx,
    18   Help;
     18  Help,
     19  {$IFDEF DPI}Dpi.Graphics, Dpi.Controls, Dpi.Forms, Dpi.Menus, Dpi.ExtCtrls,
     20  Dpi.PixelPointer, Dpi.Common{$ELSE}
     21  Graphics, Controls, Forms, Menus, ExtCtrls, PixelPointer{$ENDIF};
    1922
    2023const
     
    642645
    643646uses
    644   Directories, Log, PixelPointer, Sound, Registry, Global, KeyBindings, CmdList;
     647  Directories, Log, Sound, Registry, Global, KeyBindings, CmdList;
    645648
    646649{$R *.lfm}
     
    18091812  HGrStdUnits := LoadGraphicSet('StdUnits.png');
    18101813  SmallImp := TBitmap.Create;
    1811   SmallImp.PixelFormat := pf24bit;
     1814  SmallImp.PixelFormat := TPixelFormat.pf24bit;
    18121815  InitSmallImp;
    18131816  SoundPreloadDone := [];
     
    18691872      Brush.Color := $000000;
    18701873      FillRect(Rect(0, 0, Panel.width, Panel.height));
    1871       Brush.Style := bsClear;
     1874      Brush.Style := TBrushStyle.bsClear;
    18721875    end;
    18731876    with TopBar.Canvas do
     
    18751878      Brush.Color := $000000;
    18761879      FillRect(Rect(0, 0, TopBar.width, TopBar.height));
    1877       Brush.Style := bsClear;
     1880      Brush.Style := TBrushStyle.bsClear;
    18781881    end;
    18791882    Invalidate;
     
    28852888          Brush.Color := $000000;
    28862889          FillRect(Rect(0, 0, Panel.width, Panel.height));
    2887           Brush.Style := bsClear;
     2890          Brush.Style := TBrushStyle.bsClear;
    28882891        end;
    28892892        with TopBar.Canvas do
     
    28912894          Brush.Color := $000000;
    28922895          FillRect(Rect(0, 0, TopBar.width, TopBar.height));
    2893           Brush.Style := bsClear;
     2896          Brush.Style := TBrushStyle.bsClear;
    28942897        end;
    28952898        FormResize(nil); // place mini map correctly according to its size
     
    36343637  MiniMap := TMiniMap.Create;
    36353638  Panel := TBitmap.Create;
    3636   Panel.PixelFormat := pf24bit;
     3639  Panel.PixelFormat := TPixelFormat.pf24bit;
    36373640  Panel.Canvas.Font.Assign(UniFont[ftSmall]);
    3638   Panel.Canvas.Brush.Style := bsClear;
     3641  Panel.Canvas.Brush.Style := TBrushStyle.bsClear;
    36393642  TopBar := TBitmap.Create;
    3640   TopBar.PixelFormat := pf24bit;
     3643  TopBar.PixelFormat := TPixelFormat.pf24bit;
    36413644  TopBar.Canvas.Font.Assign(UniFont[ftNormal]);
    3642   TopBar.Canvas.Brush.Style := bsClear;
     3645  TopBar.Canvas.Brush.Style := TBrushStyle.bsClear;
    36433646  Buffer := TBitmap.Create;
    3644   Buffer.PixelFormat := pf24bit;
     3647  Buffer.PixelFormat := TPixelFormat.pf24bit;
    36453648  if 2 * lxmax > 3 * xSizeBig then Buffer.width := 2 * lxmax
    36463649    else Buffer.width := 3 * xSizeBig;
     
    48064809      Brush.Color := $000000;
    48074810      FillRect(Rect(0, 0, MapWidth, MapHeight));
    4808       Brush.Style := bsClear;
     4811      Brush.Style := TBrushStyle.bsClear;
    48094812      OffscreenUser := self;
    48104813      Exit;
     
    49914994      xRightPanel + 2, PanelHeight, ClientWidth div 2);
    49924995
    4993     Brush.Style := bsClear;
     4996    Brush.Style := TBrushStyle.bsClear;
    49944997    Pen.Color := $000000;
    49954998    MoveTo(0, 0);
     
    52165219    else if TroopLoc >= 0 then
    52175220    begin
    5218       Brush.Style := bsClear;
     5221      Brush.Style := TBrushStyle.bsClear;
    52195222      if UnFocus >= 0 then
    52205223        with MyUn^[UnFocus] do
     
    57095712begin
    57105713  if Idle and (Me >= 0) and (GameMode <> cMovie) then
    5711     if (fsModal in Screen.ActiveForm.FormState) or
     5714    if (TFormStateType.fsModal in Screen.ActiveForm.FormState) or
    57125715      (Screen.ActiveForm is TBufferedDrawDlg) and
    57135716      (TBufferedDrawDlg(Screen.ActiveForm).WindowMode <> wmPersistent) then
     
    58655868  if (MouseLoc < 0) or (MouseLoc >= G.lx * G.ly) then
    58665869    Exit;
    5867   if (Button = mbLeft) and not(ssShift in Shift) then
     5870  if (Button = TMouseButton.mbLeft) and not(ssShift in Shift) then
    58685871  begin
    58695872    DoCenter := True;
     
    59925995    end;
    59935996  end
    5994   else if (ClientMode <> cEditMap) and (Button = mbRight) and
     5997  else if (ClientMode <> cEditMap) and (Button = TMouseButton.mbRight) and
    59955998    not(ssShift in Shift) then
    59965999  begin
     
    60756078      end;
    60766079  end
    6077   else if (Button = mbMiddle) and (UnFocus >= 0) and
     6080  else if (Button = TMouseButton.mbMiddle) and (UnFocus >= 0) and
    60786081    (MyModel[MyUn[UnFocus].mix].Kind in [mkSettler, mkSlaves]) then
    60796082  begin
     
    60886091      mEnhance.Click;
    60896092  end
    6090   else if (Button = mbLeft) and (ssShift in Shift) and
     6093  else if (Button = TMouseButton.mbLeft) and (ssShift in Shift) and
    60916094    (MyMap[MouseLoc] and fTerrain <> fUNKNOWN) then
    60926095    HelpOnTerrain(MouseLoc, wmPersistent)
    6093   else if (ClientMode <= cContinue) and (Button = mbRight) and
     6096  else if (ClientMode <= cContinue) and (Button = TMouseButton.mbRight) and
    60946097    (ssShift in Shift) and (UnFocus >= 0) and
    60956098    (MyMap[MouseLoc] and (fUnit or fOwned) = fUnit) then
     
    68676870    Exit;
    68686871
    6869   if Button = mbLeft then
     6872  if Button = TMouseButton.mbLeft then
    68706873  begin
    68716874    if (X >= xMini + 2) and (Y >= yMini + 2) and (X < xMini + 2 + 2 * G.lx) and
     
    71607163procedure TMainScreen.SetFullScreen(Active: Boolean);
    71617164begin
    7162     if Active and (CurrentWindowState <> wsFullScreen) then begin
     7165    if Active and (CurrentWindowState <> TWindowState.wsFullScreen) then begin
    71637166      PrevWindowState := WindowState;
    7164       CurrentWindowState := wsFullScreen;
     7167      CurrentWindowState := TWindowState.wsFullScreen;
    71657168      WindowState := CurrentWindowState;
    71667169      {$IFDEF WINDOWS}
     
    71697172      BorderIcons := [];
    71707173    end else
    7171     if not Active and (CurrentWindowState = wsFullScreen) then begin
    7172       if PrevWindowState = wsMaximized then begin
    7173         CurrentWindowState := wsMaximized;
     7174    if not Active and (CurrentWindowState = TWindowState.wsFullScreen) then begin
     7175      if PrevWindowState = TWindowState.wsMaximized then begin
     7176        CurrentWindowState := TWindowState.wsMaximized;
    71747177        WindowState := CurrentWindowState;
    71757178      end else begin
    7176         CurrentWindowState := wsNormal;
     7179        CurrentWindowState := TWindowState.wsNormal;
    71777180        WindowState := CurrentWindowState;
    7178         WindowState := wsFullScreen;
     7181        WindowState := TWindowState.wsFullScreen;
    71797182        WindowState := CurrentWindowState;
    71807183      end;
     
    71827185      BorderStyle := bsSizeable;
    71837186      {$ENDIF}
    7184       BorderIcons := [biSystemMenu, biMinimize, biMaximize];
     7187      BorderIcons := [TBorderIcon.biSystemMenu, TBorderIcon.biMinimize,
     7188        TBorderIcon.biMaximize];
    71857189    end;
    71867190end;
     
    79547958    MouseLoc := LocationOfScreenPixel(X, Y);
    79557959    if MouseLoc <> BrushLoc then
    7956       MapBoxMouseDown(nil, mbLeft, Shift, X, Y);
     7960      MapBoxMouseDown(nil, TMouseButton.mbLeft, Shift, X, Y);
    79577961  end
    79587962  (* else if Idle and (UnFocus>=0) then
     
    80678071          TopBarHeight + MapHeight - overlap));
    80688072      end;
    8069       Brush.Style := bsClear;
     8073      Brush.Style := TBrushStyle.bsClear;
    80708074    end;
    80718075  BitBltCanvas(Canvas, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap,
Note: See TracChangeset for help on using the changeset viewer.