Ignore:
Timestamp:
Jun 25, 2020, 10:24:44 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Scaling IsoEngine ForgOfWar sprites.
  • Fixed: PopupMenu position calculated using not scaled GetSystemMetrics.
  • Fixed: Scale TDpiBitmaps using normal scaling functions to get pixels on valid expected possition.
  • Fixed: DpiBitBlt needs to be executed as StretchDraw for non-integer pixel scaling. This leads to slower drawing.
File:
1 edited

Legend:

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

    r246 r265  
    375375  begin
    376376    for i := 0 to yyt * 3 - 1 do
    377       MaskLine[i] := PixelPointer(Mask24, 0, 1 + ySrc * (yyt * 3 + 1) + i);
    378     for xSrc := 0 to 9 - 1 do
    379     begin
    380       i := ySrc * 9 + xSrc;
     377      MaskLine[i] := PixelPointer(Mask24, 0, ScaleToNative(1 + ySrc * (yyt * 3 + 1) + i));
     378    for xSrc := 0 to TerrainIconCols - 1 do begin
     379      i := ySrc * TerrainIconCols + xSrc;
    381380      TSpriteSize[i].Left := 0;
    382381      repeat
    383382        Border := true;
    384383        for y := 0 to yyt * 3 - 1 do begin
    385           MaskLine[y].SetX(1 + xSrc * (xxt * 2 + 1) + TSpriteSize[i].Left);
     384          MaskLine[y].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + TSpriteSize[i].Left));
    386385          if MaskLine[y].Pixel^.B = 0 then Border := false;
    387386        end;
     
    392391        Border := true;
    393392        for x := 0 to xxt * 2 - 1 do begin
    394           MaskLine[TSpriteSize[i].Top].SetX(1 + xSrc * (xxt * 2 + 1) + x);
     393          MaskLine[TSpriteSize[i].Top].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + x));
    395394          if MaskLine[TSpriteSize[i].Top].Pixel^.B = 0 then Border := false;
    396395        end;
     
    401400        Border := true;
    402401        for y := 0 to yyt * 3 - 1 do begin
    403           MaskLine[y].SetX(xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right);
     402          MaskLine[y].SetX(ScaleToNative(xSrc * (xxt * 2 + 1) + TSpriteSize[i].Right));
    404403          if MaskLine[y].Pixel^.B = 0 then Border := false;
    405404        end;
     
    410409        Border := true;
    411410        for x := 0 to xxt * 2 - 1 do begin
    412           MaskLine[TSpriteSize[i].Bottom - 1].SetX(1 + xSrc * (xxt * 2 + 1) + x);
     411          MaskLine[TSpriteSize[i].Bottom - 1].SetX(ScaleToNative(1 + xSrc * (xxt * 2 + 1) + x));
    413412          if MaskLine[TSpriteSize[i].Bottom - 1].Pixel^.B = 0 then Border := false;
    414413        end;
     
    10791078  if not(FoW and (Tile and fObserved = 0)) then
    10801079    PaintBorder;
    1081 
    10821080  if (Loc >= 0) and (Loc < G.lx * G.ly) and (Loc = FAdviceLoc) then
    10831081    TSprite(x, y, spPlain);
     
    12891287  i: integer;
    12901288begin
     1289  FOutput.Canvas.pen.Color := $000000; // $FF shl (8*random(3));
    12911290  FOutput.Canvas.pen.Color := $000000; // $FF shl (8*random(3));
    12921291  for i := 0 to nx div 2 do
     
    15601559        PaintTileExtraTerrain(x + xxt * dx, y + yyt + yyt * dy,
    15611560          dLoc(Loc, dx, dy));
     1561
    15621562  if CityOwner >= 0 then
    15631563  begin
Note: See TracChangeset for help on using the changeset viewer.