Ignore:
Timestamp:
Apr 16, 2024, 10:57:39 AM (4 weeks ago)
Author:
chronos
Message:
  • Fixed: Map drawing in case of fractional scaling.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r537 r538  
    5252    DefHealth: Integer;
    5353    FAdviceLoc: Integer;
    54     DataCanvas: TCanvas;
    55     MaskCanvas: TCanvas;
    5654    LandPatch: TBitmap;
    5755    OceanPatch: TBitmap;
     
    329327    raise Exception.Create(FileName + ' not found.');
    330328
     329
    331330  FileName := Format('Cities%dx%d.png', [xxt * 2, yyt * 2]);
    332331  IsoMapCache[ATileSize].HGrCities := LoadGraphicSet(FileName);
     
    584583begin
    585584  FOutput.Canvas.Font.Color := Color;
    586   FOutput.Canvas.TextRect(Rect(FLeft, FTop, FRight, FBottom), X, Y, S)
     585  FOutput.Canvas.TextRect(Rect(FLeft, FTop, FRight, FBottom), X, Y, S);
    587586end;
    588587
     
    593592  begin
    594593    Width := Width - (FLeft - X);
    595     xSrc := xSrc + (FLeft - X);
     594    XSrc := XSrc + (FLeft - X);
    596595    X := FLeft;
    597596  end;
     
    599598  begin
    600599    Height := Height - (FTop - Y);
    601     ySrc := ySrc + (FTop - Y);
     600    YSrc := YSrc + (FTop - Y);
    602601    Y := FTop;
    603602  end;
     
    609608    Exit;
    610609
     610  {$IFDEF DPI}
    611611  BitBltBitmap(FOutput, X, Y, Width, Height, Src, xSrc, ySrc, Rop);
     612  {$ELSE}
     613  BitBltCanvas(FOutput.Canvas, X, Y, Width, Height, Src.Canvas, xSrc, ySrc, Rop);
     614  {$ENDIF}
    612615end;
    613616
     
    649652    Exit;
    650653
    651   BitBltCanvas(FOutput.Canvas, xDst, yDst, Width, Height, MaskCanvas, xSrc, ySrc, SRCAND);
     654  BitBltBitmap(FOutput, xDst, yDst, Width, Height, HGrTerrain.Mask, xSrc, ySrc, SRCAND);
    652655  if not PureBlack then
    653     BitBltCanvas(FOutput.Canvas, xDst, yDst, Width, Height, DataCanvas, xSrc, ySrc, SRCPAINT);
     656    BitBltBitmap(FOutput, xDst, yDst, Width, Height, HGrTerrain.Data, xSrc, ySrc, SRCPAINT);
    654657end;
    655658
     
    707710      if Flags and unFortified <> 0 then
    708711      begin
    709         { DataCanvas := HGrTerrain.Data.Canvas;
    710           MaskCanvas := HGrTerrain.Mask.Canvas;
    711           TerrainSprite(X, Y + 16, 12 * 9 + 7);  }
     712        { TerrainSprite(X, Y + 16, 12 * 9 + 7);  }
    712713        Sprite(HGrStdUnits, X, Y, xxu * 2, yyu * 2, 1 + 6 * (xxu * 2 + 1), 1);
    713714      end;
     
    11521153  end; { square not discovered }
    11531154
    1154   if not(FoW and (Tile and fObserved = 0)) then
     1155  if not (FoW and (Tile and fObserved = 0)) then
    11551156    PaintBorder;
    11561157
     
    15691570                end;
    15701571              BitBltBitmapOutput(OceanPatch, X + dx * xxt, Y + dy * yyt, xxt, yyt,
    1571                 Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY)
    1572             end
     1572                Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY);
     1573            end;
    15731574          end
    15741575          else
     
    16251626            else
    16261627              BitBltBitmapOutput(LandPatch, X + dx * xxt, Y + dy * yyt, xxt, yyt,
    1627                 Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY)
     1628                Aix * (xxt * 2) + (dx + dy + 1) and 1 * xxt, bix * yyt, SRCCOPY);
    16281629          end;
    16291630      end;
    16301631
    1631   DataCanvas := HGrTerrain.Data.Canvas;
    1632   MaskCanvas := HGrTerrain.Mask.Canvas;
    16331632  for dy := -2 to ny + 1 do
    16341633    for dx := -1 to nx do
     
    16401639        PaintTileExtraTerrain(X + xxt * dx, Y + yyt + yyt * dy,
    16411640          dLoc(Loc, dx, dy));
     1641
    16421642  if CityOwner >= 0 then
    16431643  begin
Note: See TracChangeset for help on using the changeset viewer.