Ignore:
Timestamp:
May 9, 2020, 4:02:07 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved HighDPI branch. Imported new changes from trunk branch.
File:
1 edited

Legend:

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

    r193 r210  
    55
    66uses
    7   Messg, Protocol, ScreenTools, Platform, DateUtils, UDpiControls,
     7  UDpiControls, Messg, Protocol, ScreenTools, Platform, DateUtils,
    88  LCLIntf, LCLType, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    99  ButtonB, StdCtrls, DrawDlg;
     
    7373
    7474uses
    75   ClientTools, BaseWin, Term, Help, UnitStat, Tribes,
    76   IsoEngine, Diagram;
     75  ClientTools, BaseWin, Term, Help, UnitStat, Tribes, UPixelPointer,
     76  IsoEngine, Diagram, Sound;
    7777
    7878{$R *.lfm}
     
    209209      Ticks0 := NowPrecise;
    210210      repeat
    211         Application.ProcessMessages;
     211        DpiApplication.ProcessMessages;
    212212        Sleep(1);
    213213        Ticks := NowPrecise;
     
    246246    for iy := 0 to 39 do begin
    247247      for ix := 0 to 55 do begin
    248         SrcPtr.Init(BigImp, ix + xIcon, iy + yIcon);
     248        SrcPtr := PixelPointer(BigImp, ix + xIcon, iy + yIcon);
    249249        xR := ix * (37 + iy * 5 / 40) / 56;
    250250        xDst := Trunc(xR);
     
    291291
    292292  // paint
    293   BitBltCanvas(LogoBuffer.Canvas, 0, 0, wb, hb, ca, x, y, SRCCOPY);
     293  DpiBitCanvas(LogoBuffer.Canvas, 0, 0, wb, hb, ca, x, y);
    294294
    295295  if IconIndex >= 0 then
     
    304304  ImageOp_BCC(LogoBuffer, Templates, 0, 0, xb, yb, wb, hb, clCover, clPage);
    305305
    306   DpiBitBlt(ca.Handle, x, y, wb, hb, LogoBuffer.Canvas.Handle, 0, 0, SRCCOPY);
     306  DpiBitCanvas(ca, x, y, wb, hb, LogoBuffer.Canvas, 0, 0);
    307307end;
    308308
     
    328328      with MyRO.EnemyModel[emix], Tribe[Owner].ModelPicture[mix] do
    329329      begin
    330         DpiBitBlt(Canvas.Handle, x, y, 64, 48, GrExt[HGr].Mask.Canvas.Handle,
     330        DpiBitCanvas(Canvas, x, y, 64, 48, GrExt[HGr].Mask.Canvas,
    331331          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCAND);
    332         DpiBitBlt(Canvas.Handle, x, y, 64, 48, GrExt[HGr].Data.Canvas.Handle,
     332        DpiBitCanvas(Canvas, x, y, 64, 48, GrExt[HGr].Data.Canvas,
    333333          pix mod 10 * 65 + 1, pix div 10 * 49 + 1, SRCPAINT);
    334334      end;
     
    345345        if UnitsInLine > LostUnitsPerLine then
    346346          UnitsInLine := LostUnitsPerLine;
    347       end
     347      end;
    348348    end;
    349349end;
     
    371371      begin
    372372        p1 := MyRO.Wonder[IconIndex].EffectiveOwner;
    373         DpiBitBlt(Buffer.Canvas.Handle, 0, 0, xSizeBig + 2 * GlowRange,
    374           ySizeBig + 2 * GlowRange, Canvas.Handle,
    375           ClientWidth div 2 - (28 + GlowRange), 24 - GlowRange, SRCCOPY);
    376         DpiBitBlt(Buffer.Canvas.Handle, GlowRange, GlowRange, xSizeBig, ySizeBig,
    377           BigImp.Canvas.Handle, IconIndex mod 7 * xSizeBig,
    378           (IconIndex + SystemIconLines * 7) div 7 * ySizeBig, SRCCOPY);
     373        DpiBitCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
     374          ySizeBig + 2 * GlowRange, Canvas,
     375          ClientWidth div 2 - (28 + GlowRange), 24 - GlowRange);
     376        DpiBitCanvas(Buffer.Canvas, GlowRange, GlowRange, xSizeBig, ySizeBig,
     377          BigImp.Canvas, IconIndex mod 7 * xSizeBig,
     378          (IconIndex + SystemIconLines * 7) div 7 * ySizeBig);
    379379        if p1 < 0 then
    380380          GlowFrame(Buffer, GlowRange, GlowRange, xSizeBig, ySizeBig, $000000)
     
    382382          GlowFrame(Buffer, GlowRange, GlowRange, xSizeBig, ySizeBig,
    383383            Tribe[p1].Color);
    384         DpiBitBlt(Canvas.Handle, ClientWidth div 2 - (28 + GlowRange),
     384        DpiBitCanvas(Canvas, ClientWidth div 2 - (28 + GlowRange),
    385385          24 - GlowRange, xSizeBig + 2 * GlowRange, ySizeBig + 2 * GlowRange,
    386           Buffer.Canvas.Handle, 0, 0, SRCCOPY);
     386          Buffer.Canvas, 0, 0);
    387387      end
    388388      else
     
    400400        FrameImage(Canvas, BigImp, ClientWidth div 2 - 28, 24, xSizeBig,
    401401          ySizeBig, 0, 0);
    402         DpiBitBlt(Canvas.Handle, ClientWidth div 2 - 32, 20, 64, 44,
    403           GrExt[HGr].Mask.Canvas.Handle, pix mod 10 * 65 + 1,
     402        DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
     403          GrExt[HGr].Mask.Canvas, pix mod 10 * 65 + 1,
    404404          pix div 10 * 49 + 1, SRCAND);
    405         DpiBitBlt(Canvas.Handle, ClientWidth div 2 - 32, 20, 64, 44,
    406           GrExt[HGr].Data.Canvas.Handle, pix mod 10 * 65 + 1,
     405        DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 20, 64, 44,
     406          GrExt[HGr].Data.Canvas, pix mod 10 * 65 + 1,
    407407          pix div 10 * 49 + 1, SRCPAINT);
    408408      end;
     
    415415        Frame(Canvas, ClientWidth div 2 - 32 - 1, 24 - 1,
    416416          ClientWidth div 2 + 32, 24 + 48, $000000, $000000);
    417         DpiBitBlt(Canvas.Handle, ClientWidth div 2 - 32, 24, 64, 48,
    418           GrExt[Tribe[IconIndex].faceHGr].Data.Canvas.Handle,
     417        DpiBitCanvas(Canvas, ClientWidth div 2 - 32, 24, 64, 48,
     418          GrExt[Tribe[IconIndex].faceHGr].Data.Canvas,
    419419          1 + Tribe[IconIndex].facepix mod 10 * 65,
    420           1 + Tribe[IconIndex].facepix div 10 * 49, SRCCOPY)
     420          1 + Tribe[IconIndex].facepix div 10 * 49)
    421421      end;
    422422    mikPureIcon:
     
    429429    mikEnemyShipComplete:
    430430      begin
    431         BitBltCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
    432           (ClientWidth - 140) div 2, 24, SRCCOPY);
     431        DpiBitCanvas(Buffer.Canvas, 0, 0, 140, 120, Canvas,
     432          (ClientWidth - 140) div 2, 24);
    433433        ImageOp_BCC(Buffer, Templates, 0, 0, 1, 279, 140, 120, 0, $FFFFFF);
    434         DpiBitBlt(Canvas.Handle, (ClientWidth - 140) div 2, 24, 140, 120,
    435           Buffer.Canvas.Handle, 0, 0, SRCCOPY);
     434        DpiBitCanvas(Canvas, (ClientWidth - 140) div 2, 24, 140, 120,
     435          Buffer.Canvas, 0, 0);
    436436      end;
    437437    mikMyArmy:
     
    450450  if OpenSound <> '' then
    451451    PostMessage(Handle, WM_PLAYSOUND, 0, 0);
    452 end; { FormPaint }
     452end;
    453453
    454454procedure TMessgExDlg.Button1Click(Sender: TObject);
     
    469469procedure TMessgExDlg.Button3Click(Sender: TObject);
    470470begin
    471   ModalResult := mrCancel
     471  ModalResult := mrCancel;
    472472end;
    473473
    474474procedure TMessgExDlg.RemoveBtnClick(Sender: TObject);
    475475begin
    476   ModalResult := mrNo
     476  ModalResult := mrNo;
    477477end;
    478478
     
    485485      ModalResult := mrCancel
    486486    else if Button2.Visible then
    487       ModalResult := mrIgnore
     487      ModalResult := mrIgnore;
    488488end;
    489489
     
    497497    Kind := mkOk;
    498498    ShowModal;
    499   end
     499  end;
    500500end;
    501501
     
    522522    Kind := QueryKind;
    523523    ShowModal;
    524     result := ModalResult
    525   end
     524    result := ModalResult;
     525  end;
    526526end;
    527527
     
    537537    HelpNo := ContextNo;
    538538    ShowModal;
    539   end
     539  end;
    540540end;
    541541
     
    552552end;
    553553
     554
    554555initialization
    555556
Note: See TracChangeset for help on using the changeset viewer.