Ignore:
Timestamp:
Jun 23, 2019, 9:12:54 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved scaling support.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/LocalPlayer/Term.pas

    r178 r179  
    27462746          begin
    27472747            if AILogo[pLogo] <> nil then
    2748               BitBlt(Canvas.Handle, (xRightPanel + 10) - (16 + 64),
     2748              DpiBitBlt(Canvas.Handle, (xRightPanel + 10) - (16 + 64),
    27492749                ClientHeight - PanelHeight, 64, 64, AILogo[pLogo].Canvas.Handle,
    27502750                0, 0, SRCCOPY);
     
    40424042  begin
    40434043    if xMap < 0 then
    4044       BitBlt(Canvas.Handle, MapOffset, TopBarHeight, width + xMap,
     4044      DpiBitBlt(Canvas.Handle, MapOffset, TopBarHeight, width + xMap,
    40454045        height + yMap, Buffer.Canvas.Handle, -xMap, -yMap, SRCCOPY)
    40464046    else
    4047       BitBlt(Canvas.Handle, xMap + MapOffset, TopBarHeight, width,
     4047      DpiBitBlt(Canvas.Handle, xMap + MapOffset, TopBarHeight, width,
    40484048        height + yMap, Buffer.Canvas.Handle, 0, -yMap, SRCCOPY)
    40494049  end
     
    40514051  begin
    40524052    if xMap < 0 then
    4053       BitBlt(Canvas.Handle, MapOffset, TopBarHeight + yMap, width + xMap,
     4053      DpiBitBlt(Canvas.Handle, MapOffset, TopBarHeight + yMap, width + xMap,
    40544054        height, Buffer.Canvas.Handle, -xMap, 0, SRCCOPY)
    40554055    else
    4056       BitBlt(Canvas.Handle, xMap + MapOffset, TopBarHeight + yMap, width,
     4056      DpiBitBlt(Canvas.Handle, xMap + MapOffset, TopBarHeight + yMap, width,
    40574057        height, Buffer.Canvas.Handle, 0, 0, SRCCOPY);
    40584058  end
     
    43254325procedure TMainScreen.CopyMiniToPanel;
    43264326begin
    4327   BitBlt(Panel.Canvas.Handle, xMini + 2, yMini + 2, G.lx * 2, G.ly,
     4327  DpiBitBlt(Panel.Canvas.Handle, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    43284328    Mini.Canvas.Handle, 0, 0, SRCCOPY);
    43294329  if MarkCityLoc >= 0 then
     
    44144414          ClientWidth - xPalace + xSizeBig + 1, yPalace + ySizeBig + 1,
    44154415          $FFFFFF, $B0B0B0);
    4416         BitBlt(Panel.Canvas.Handle, ClientWidth - xPalace, yPalace, xSizeBig,
     4416        DpiBitBlt(Panel.Canvas.Handle, ClientWidth - xPalace, yPalace, xSizeBig,
    44174417          ySizeBig, GrExt[HGrSystem2].Data.Canvas.Handle, 70, 123, SRCCOPY);
    44184418      end
     
    52725272      PaintLoc(MouseLoc, 2);
    52735273      MiniPaint;
    5274       BitBlt(Panel.Canvas.Handle, xMini + 2, yMini + 2, G.lx * 2, G.ly,
     5274      DpiBitBlt(Panel.Canvas.Handle, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    52755275        Mini.Canvas.Handle, 0, 0, SRCCOPY);
    52765276      if ywmax <= 0 then
     
    60966096    for Step := 0 to abs(Step1 - Step0) do
    60976097    begin
    6098       BitBlt(Buffer.Canvas.Handle, 0, 0, xRange, yRange,
     6098      DpiBitBlt(Buffer.Canvas.Handle, 0, 0, xRange, yRange,
    60996099        offscreen.Canvas.Handle, xMin, yMin, SRCCOPY);
    61006100      if Step1 <> Step0 then
     
    61386138  if Restore then
    61396139  begin
    6140     BitBlt(Buffer.Canvas.Handle, 0, 0, xRange, yRange, offscreen.Canvas.Handle,
     6140    DpiBitBlt(Buffer.Canvas.Handle, 0, 0, xRange, yRange, offscreen.Canvas.Handle,
    61416141      xMin, yMin, SRCCOPY);
    61426142    PaintBufferToScreen(xMin, yMin, xRange, yRange);
     
    74897489  InitPopup(Popup);
    74907490  if FullScreen then
    7491     Popup.Popup(Left + TControl(Sender).Left, Top + TControl(Sender).Top)
     7491    Popup.Popup(Left + TDpiControl(Sender).Left, Top + TDpiControl(Sender).Top)
    74927492  else
    7493     Popup.Popup(Left + TControl(Sender).Left + 4, Top + TControl(Sender).Top +
     7493    Popup.Popup(Left + TDpiControl(Sender).Left + 4, Top + TDpiControl(Sender).Top +
    74947494      GetSystemMetrics(SM_CYCAPTION) + 4);
    74957495end;
     
    75537553          yw := ywmax;
    75547554      end;
    7555       BitBlt(Buffer.Canvas.Handle, 0, 0, G.lx * 2, G.ly, Mini.Canvas.Handle, 0,
     7555      DpiBitBlt(Buffer.Canvas.Handle, 0, 0, G.lx * 2, G.ly, Mini.Canvas.Handle, 0,
    75567556        0, SRCCOPY);
    75577557      if ywmax <= 0 then
     
    75637563          x - xMini - 2 + MapWidth div (xxt * 2) - 1, yw + MapHeight div yyt -
    75647564          2, MainTexture.clMark, MainTexture.clMark);
    7565       BitBlt(Panel.Canvas.Handle, xMini + 2, yMini + 2, G.lx * 2, G.ly,
     7565      DpiBitBlt(Panel.Canvas.Handle, xMini + 2, yMini + 2, G.lx * 2, G.ly,
    75667566        Buffer.Canvas.Handle, 0, 0, SRCCOPY);
    75677567      MainOffscreenPaint;
     
    77157715      Brush.Style := bsClear;
    77167716    end;
    7717   BitBlt(Canvas.Handle, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap,
     7717  DpiBitBlt(Canvas.Handle, MapOffset, TopBarHeight, MapWidth, MapHeight - overlap,
    77187718    offscreen.Canvas.Handle, 0, 0, SRCCOPY);
    7719   BitBlt(Canvas.Handle, 0, 0, ClientWidth, TopBarHeight, TopBar.Canvas.Handle,
     7719  DpiBitBlt(Canvas.Handle, 0, 0, ClientWidth, TopBarHeight, TopBar.Canvas.Handle,
    77207720    0, 0, SRCCOPY);
    77217721  if xMidPanel > MapOffset then
    7722     BitBlt(Canvas.Handle, xMidPanel, TopBarHeight + MapHeight - overlap,
     7722    DpiBitBlt(Canvas.Handle, xMidPanel, TopBarHeight + MapHeight - overlap,
    77237723      ClientWidth div 2 - xMidPanel, overlap, offscreen.Canvas.Handle,
    77247724      xMidPanel - MapOffset, MapHeight - overlap, SRCCOPY)
    77257725  else
    7726     BitBlt(Canvas.Handle, MapOffset, TopBarHeight + MapHeight - overlap,
     7726    DpiBitBlt(Canvas.Handle, MapOffset, TopBarHeight + MapHeight - overlap,
    77277727      ClientWidth div 2 - MapOffset, overlap, offscreen.Canvas.Handle, 0,
    77287728      MapHeight - overlap, SRCCOPY);
    77297729  if xRightPanel < MapOffset + MapWidth then
    7730     BitBlt(Canvas.Handle, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
     7730    DpiBitBlt(Canvas.Handle, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
    77317731      xRightPanel - ClientWidth div 2, overlap, offscreen.Canvas.Handle,
    77327732      ClientWidth div 2 - MapOffset, MapHeight - overlap, SRCCOPY)
    77337733  else
    7734     BitBlt(Canvas.Handle, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
     7734    DpiBitBlt(Canvas.Handle, ClientWidth div 2, TopBarHeight + MapHeight - overlap,
    77357735      MapOffset + MapWidth - ClientWidth div 2, overlap,
    77367736      offscreen.Canvas.Handle, ClientWidth div 2 - MapOffset,
    77377737      MapHeight - overlap, SRCCOPY);
    7738   BitBlt(Canvas.Handle, 0, TopBarHeight + MapHeight - overlap, xMidPanel,
     7738  DpiBitBlt(Canvas.Handle, 0, TopBarHeight + MapHeight - overlap, xMidPanel,
    77397739    overlap, Panel.Canvas.Handle, 0, 0, SRCCOPY);
    7740   BitBlt(Canvas.Handle, xRightPanel, TopBarHeight + MapHeight - overlap,
     7740  DpiBitBlt(Canvas.Handle, xRightPanel, TopBarHeight + MapHeight - overlap,
    77417741    Panel.width - xRightPanel, overlap, Panel.Canvas.Handle, xRightPanel,
    77427742    0, SRCCOPY);
    7743   BitBlt(Canvas.Handle, 0, TopBarHeight + MapHeight, Panel.width,
     7743  DpiBitBlt(Canvas.Handle, 0, TopBarHeight + MapHeight, Panel.width,
    77447744    PanelHeight - overlap, Panel.Canvas.Handle, 0, overlap, SRCCOPY);
    77457745  if (pLogo >= 0) and (G.RO[pLogo] = nil) and (AILogo[pLogo] <> nil) then
    7746     BitBlt(Canvas.Handle, xRightPanel + 10 - (16 + 64),
     7746    DpiBitBlt(Canvas.Handle, xRightPanel + 10 - (16 + 64),
    77477747      ClientHeight - PanelHeight, 64, 64, AILogo[pLogo].Canvas.Handle, 0,
    77487748      0, SRCCOPY);
     
    77537753  r0: HRgn;
    77547754begin
    7755   r0 := CreateRectRgn(Left, Top, Rigth, Bottom);
     7755  r0 := DpiCreateRectRgn(Left, Top, Rigth, Bottom);
    77567756  InvalidateRgn(Handle, r0, false);
    77577757  DeleteObject(r0);
     
    77637763  r0, r1: HRgn;
    77647764begin
    7765   r0 := CreateRectRgn(Left, Top, Rigth, Bottom);
     7765  r0 := DpiCreateRectRgn(Left, Top, Rigth, Bottom);
    77667766  for i := 0 to ControlCount - 1 do
    77677767    if not(Controls[i] is TArea) and Controls[i].Visible then
    77687768    begin
    77697769      with Controls[i].BoundsRect do
    7770         r1 := CreateRectRgn(Left, Top, Right, Bottom);
     7770        r1 := DpiCreateRectRgn(Left, Top, Right, Bottom);
    77717771      CombineRgn(r0, r0, r1, RGN_DIFF);
    77727772      DeleteObject(r1);
Note: See TracChangeset for help on using the changeset viewer.