Ignore:
Timestamp:
Jun 23, 2019, 3:15:29 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Use DpiControls package for High DPI support.
File:
1 edited

Legend:

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

    r170 r178  
    55
    66uses
    7   Protocol, ClientTools, ScreenTools, Tribes,
     7  Protocol, ClientTools, ScreenTools, Tribes, UDpiControls,
    88{$IFNDEF SCR}Term, {$ENDIF}
    9   LCLIntf, LCLType, SysUtils, Classes, Graphics, PixelPointer;
     9  LCLIntf, LCLType, SysUtils, Classes, Graphics;
    1010
    1111type
     
    1616  TIsoMap = class
    1717    constructor Create;
    18     procedure SetOutput(Output: TBitmap);
     18    procedure SetOutput(Output: TDpiBitmap);
    1919    procedure SetPaintBounds(Left, Top, Right, Bottom: integer);
    2020    procedure Paint(x, y, Loc, nx, ny, CityLoc, CityOwner: integer;
     
    2424    procedure PaintCity(x, y: integer; const CityInfo: TCityInfo;
    2525      accessory: boolean = true);
    26     procedure BitBlt(Src: TBitmap; x, y, Width, Height, xSrc, ySrc,
     26    procedure BitBlt(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,
    2727      Rop: integer);
    2828
     
    3737    procedure ShadeOutside(x0, y0, x1, y1, xm, ym: integer);
    3838  protected
    39     FOutput: TBitmap;
     39    FOutput: TDpiBitmap;
    4040    FLeft, FTop, FRight, FBottom, RealTop, RealBottom, AttLoc, DefLoc,
    4141      DefHealth, FAdviceLoc: integer;
     
    113113  BordersOK: integer;
    114114  OnInitEnemyModel: TInitEnemyModelEvent;
    115   LandPatch, OceanPatch, Borders: TBitmap;
     115  LandPatch, OceanPatch, Borders: TDpiBitmap;
    116116  TSpriteSize: array [0 .. TerrainIconLines * 9 - 1] of TRect;
    117117  DebugMap: ^TTileList;
     
    136136var
    137137  i, x, y, xSrc, ySrc, HGrTerrainNew, HGrCitiesNew, age, size: integer;
    138   LandMore, OceanMore, DitherMask, Mask24: TBitmap;
     138  LandMore, OceanMore, DitherMask, Mask24: TDpiBitmap;
    139139  MaskLine: array [0 .. 32 * 3 - 1] of TPixelPointer; // 32 = assumed maximum for yyt
    140140  Border: boolean;
     
    165165  if LandPatch <> nil then
    166166    LandPatch.Free;
    167   LandPatch := TBitmap.Create;
     167  LandPatch := TDpiBitmap.Create;
    168168  LandPatch.PixelFormat := pf24bit;
    169169  LandPatch.Canvas.Brush.Color := 0;
     
    172172  if OceanPatch <> nil then
    173173    OceanPatch.Free;
    174   OceanPatch := TBitmap.Create;
     174  OceanPatch := TDpiBitmap.Create;
    175175  OceanPatch.PixelFormat := pf24bit;
    176176  OceanPatch.Canvas.Brush.Color := 0;
    177177  OceanPatch.SetSize(xxt * 8, yyt * 4);
    178178  OceanPatch.Canvas.FillRect(0, 0, OceanPatch.Width, OceanPatch.Height);
    179   LandMore := TBitmap.Create;
     179  LandMore := TDpiBitmap.Create;
    180180  LandMore.PixelFormat := pf24bit;
    181181  LandMore.Canvas.Brush.Color := 0;
    182182  LandMore.SetSize(xxt * 18, yyt * 9);
    183183  LandMore.Canvas.FillRect(0, 0, LandMore.Width, LandMore.Height);
    184   OceanMore := TBitmap.Create;
     184  OceanMore := TDpiBitmap.Create;
    185185  OceanMore.PixelFormat := pf24bit;
    186186  OceanMore.Canvas.Brush.Color := 0;
    187187  OceanMore.SetSize(xxt * 8, yyt * 4);
    188188  OceanMore.Canvas.FillRect(0, 0, OceanMore.Width, OceanMore.Height);
    189   DitherMask := TBitmap.Create;
     189  DitherMask := TDpiBitmap.Create;
    190190  DitherMask.PixelFormat := pf24bit;
    191191  DitherMask.SetSize(xxt * 2, yyt * 2);
     
    366366
    367367  // reduce size of terrain icons
    368   Mask24 := TBitmap.Create;
     368  Mask24 := TDpiBitmap.Create;
    369369  Mask24.Assign(GrExt[HGrTerrain].Mask);
    370370  Mask24.PixelFormat := pf24bit;
     
    420420  if Borders <> nil then
    421421    Borders.Free;
    422   Borders := TBitmap.Create;
     422  Borders := TDpiBitmap.Create;
    423423  Borders.PixelFormat := pf24bit;
    424424  Borders.SetSize(xxt * 2,(yyt * 2) * nPl);
     
    452452end;
    453453
    454 procedure TIsoMap.SetOutput(Output: TBitmap);
     454procedure TIsoMap.SetOutput(Output: TDpiBitmap);
    455455begin
    456456  FOutput := Output;
     
    499499end;
    500500
    501 procedure TIsoMap.BitBlt(Src: TBitmap; x, y, Width, Height, xSrc, ySrc,
     501procedure TIsoMap.BitBlt(Src: TDpiBitmap; x, y, Width, Height, xSrc, ySrc,
    502502  Rop: integer);
    503503begin
Note: See TracChangeset for help on using the changeset viewer.