Ignore:
Timestamp:
May 9, 2020, 4:02:07 PM (4 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/UnitStat.pas

    r193 r210  
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, BaseWin, UDpiControls,
     7  UDpiControls, Protocol, ClientTools, Term, ScreenTools, BaseWin,
    88  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls, Forms,
    99  ButtonB, ButtonC;
     
    8383  Template := TDpiBitmap.Create;
    8484  Template.PixelFormat := pf24bit;
    85   LoadGraphicFile(Template, HomeDir + 'Graphics' + DirectorySeparator + 'Unit.png', gfNoGamma);
     85  LoadGraphicFile(Template, GetGraphicsDir + DirectorySeparator + 'Unit.png', gfNoGamma);
    8686end;
    8787
     
    9797  begin
    9898    AgePrepared := MainTextureAge;
    99     Dpibitblt(Back.Canvas.Handle, 0, 0, wCommon, hOwnModel,
    100       MainTexture.Image.Canvas.Handle, (wMainTexture - wCommon) div 2,
    101       (hMainTexture - hOwnModel) div 2, SRCCOPY);
    102     Dpibitblt(Back.Canvas.Handle, wCommon, 0, wCommon, hEnemyModel,
    103       MainTexture.Image.Canvas.Handle, (wMainTexture - wCommon) div 2,
    104       (hMainTexture - hEnemyModel) div 2, SRCCOPY);
    105     Dpibitblt(Back.Canvas.Handle, 2 * wCommon, 0, wCommon, hEnemyUnit,
    106       MainTexture.Image.Canvas.Handle, (wMainTexture - wCommon) div 2,
    107       (hMainTexture - hEnemyUnit) div 2, SRCCOPY);
    108     Dpibitblt(Back.Canvas.Handle, 3 * wCommon, 0, wCommon, hEnemyCityDefense,
    109       MainTexture.Image.Canvas.Handle, (wMainTexture - wCommon) div 2,
    110       (hMainTexture - hEnemyCityDefense) div 2, SRCCOPY);
    111     Dpibitblt(Back.Canvas.Handle, 4 * wCommon, 0, wCommon, hEnemyCity,
    112       MainTexture.Image.Canvas.Handle, (wMainTexture - wCommon) div 2,
    113       (hMainTexture - hEnemyCity) div 2, SRCCOPY);
     99    DpiBitCanvas(Back.Canvas, 0, 0, wCommon, hOwnModel,
     100      MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
     101      (hMainTexture - hOwnModel) div 2);
     102    DpiBitCanvas(Back.Canvas, wCommon, 0, wCommon, hEnemyModel,
     103      MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
     104      (hMainTexture - hEnemyModel) div 2);
     105    DpiBitCanvas(Back.Canvas, 2 * wCommon, 0, wCommon, hEnemyUnit,
     106      MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
     107      (hMainTexture - hEnemyUnit) div 2);
     108    DpiBitCanvas(Back.Canvas, 3 * wCommon, 0, wCommon, hEnemyCityDefense,
     109      MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
     110      (hMainTexture - hEnemyCityDefense) div 2);
     111    DpiBitCanvas(Back.Canvas, 4 * wCommon, 0, wCommon, hEnemyCity,
     112      MainTexture.Image.Canvas, (wMainTexture - wCommon) div 2,
     113      (hMainTexture - hEnemyCity) div 2);
    114114    ImageOp_B(Back, Template, 0, 0, 0, 0, 5 * wCommon, hMax);
    115115  end
     
    387387    dkOwnModel:
    388388      begin
    389         Dpibitblt(offscreen.Canvas.Handle, 0, 0, wCommon, hOwnModel,
    390           Back.Canvas.Handle, 0, 0, SRCCOPY);
     389        DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hOwnModel,
     390          Back.Canvas, 0, 0);
    391391        yView := 13;
    392392        yTotal := 92;
     
    394394    dkEnemyModel:
    395395      begin
    396         Dpibitblt(offscreen.Canvas.Handle, 0, 0, wCommon, hEnemyModel,
    397           Back.Canvas.Handle, wCommon, 0, SRCCOPY);
     396        DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyModel,
     397          Back.Canvas, wCommon, 0);
    398398        yView := 13;
    399399        yTotal := 92;
     
    401401    dkEnemyUnit, dkOwnUnit:
    402402      begin
    403         Dpibitblt(offscreen.Canvas.Handle, 0, 0, wCommon, hEnemyUnit,
    404           Back.Canvas.Handle, 2 * wCommon, 0, SRCCOPY);
     403        DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyUnit,
     404          Back.Canvas, 2 * wCommon, 0);
    405405        yView := 13;
    406406        yTotal := 123;
     
    408408    dkEnemyCityDefense:
    409409      begin
    410         Dpibitblt(offscreen.Canvas.Handle, 0, 0, wCommon, hEnemyCityDefense,
    411           Back.Canvas.Handle, 3 * wCommon, 0, SRCCOPY);
     410        DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyCityDefense,
     411          Back.Canvas, 3 * wCommon, 0);
    412412        yView := 171;
    413413        yTotal := 231;
     
    415415    dkEnemyCity:
    416416      begin
    417         Dpibitblt(offscreen.Canvas.Handle, 0, 0, wCommon, hEnemyCity,
    418           Back.Canvas.Handle, 4 * wCommon, 0, SRCCOPY);
     417        DpiBitCanvas(offscreen.Canvas, 0, 0, wCommon, hEnemyCity,
     418          Back.Canvas, 4 * wCommon, 0);
    419419      end;
    420420  end;
     
    445445          yImp + ySizeSmall, MainTexture.clBevelLight,
    446446          MainTexture.clBevelShade);
    447         Dpibitblt(offscreen.Canvas.Handle, x, yImp, xSizeSmall, ySizeSmall,
    448           SmallImp.Canvas.Handle, j mod 7 * xSizeSmall,
    449           (j + SystemIconLines * 7) div 7 * ySizeSmall, SRCCOPY);
     447        DpiBitCanvas(offscreen.Canvas, x, yImp, xSizeSmall, ySizeSmall,
     448          SmallImp.Canvas, j mod 7 * xSizeSmall,
     449          (j + SystemIconLines * 7) div 7 * ySizeSmall);
    450450        inc(x, xSizeSmall + 4)
    451451      end;
     
    564564                    * (yyt * 3 + 1));
    565565              end;
    566           Dpibitblt(offscreen.Canvas.Handle, xView, yView + 16, 64, 32,
    567             Buffer.Canvas.Handle, 1, 0, SRCCOPY);
     566          DpiBitCanvas(offscreen.Canvas, xView, yView + 16, 64, 32,
     567            Buffer.Canvas, 1, 0);
    568568
    569569          // show unit, experience and health
Note: See TracChangeset for help on using the changeset viewer.