Changeset 608 for trunk


Ignore:
Timestamp:
Aug 26, 2024, 6:30:43 PM (3 months ago)
Author:
chronos
Message:
  • Fixed: Build without DPI define.
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/IsoEngine.pas

    r552 r608  
    373373  DitherMask.SetSize(xxt * 2, yyt * 2);
    374374  DitherMask.Canvas.FillRect(0, 0, DitherMask.Width, DitherMask.Height);
    375   BitBltBitmap(DitherMask, 0, 0, xxt * 2, yyt * 2,
     375  BitBltBitmapPrecise(DitherMask, 0, 0, xxt * 2, yyt * 2,
    376376    HGrTerrain.Mask, 1 + 7 * (xxt * 2 + 1),
    377377    1 + yyt + 15 * (yyt * 3 + 1), SRCAND, True);
     
    390390    end;
    391391    for Y := -1 to 6 do
    392       BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt,
     392      BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt,
    393393        xxt * 2, yyt, HGrTerrain.Data, xSrc, ySrc, SRCCOPY, True);
    394394    for Y := -2 to 6 do
    395       BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt,
     395      BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt,
    396396        yyt, HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT, True);
    397397    for Y := -2 to 6 do
    398       BitBltBitmap(LandPatch, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt,
     398      BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt,
    399399        xxt, yyt, HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT, True);
    400400    for Y := -2 to 6 do
    401       BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt,
     401      BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt, xxt,
    402402        yyt, DitherMask, xxt, yyt, SRCAND, True);
    403403    for Y := -2 to 6 do
    404       BitBltBitmap(LandPatch, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt,
     404      BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2) + xxt, (Y + 2) * yyt,
    405405        xxt, yyt, DitherMask, 0, yyt, SRCAND, True);
    406406  end;
     
    419419    end;
    420420    for X := -2 to 6 do
    421       BitBltBitmap(LandMore, (X + 2) * (xxt * 2), (Y + 2) * yyt,
     421      BitBltBitmapPrecise(LandMore, (X + 2) * (xxt * 2), (Y + 2) * yyt,
    422422        xxt * 2, yyt, HGrTerrain.Data, xSrc, ySrc, SRCCOPY, True);
    423     BitBltBitmap(LandMore, xxt * 2, (Y + 2) * yyt, xxt, yyt,
     423    BitBltBitmapPrecise(LandMore, xxt * 2, (Y + 2) * yyt, xxt, yyt,
    424424      HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT, True);
    425425    for X := 0 to 7 do
    426       BitBltBitmap(LandMore, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt,
     426      BitBltBitmapPrecise(LandMore, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt,
    427427        xxt * 2, yyt, HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT, True);
    428428    for X := -2 to 6 do
    429       BitBltBitmap(LandMore, (X + 2) * (xxt * 2), (Y + 2) * yyt,
     429      BitBltBitmapPrecise(LandMore, (X + 2) * (xxt * 2), (Y + 2) * yyt,
    430430        xxt * 2, yyt, DitherMask, 0, 0, SRCAND, True);
    431431  end;
     
    438438      ySrc := 1 + yyt;
    439439      if (X >= 1) = (Y >= 2) then
    440         BitBltBitmap(OceanPatch, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
     440        BitBltBitmapPrecise(OceanPatch, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
    441441          HGrTerrain.Data, xSrc, ySrc, SRCCOPY, True);
    442442      if (X >= 1) and ((Y < 2) or (X >= 2)) then
    443443      begin
    444         BitBltBitmap(OceanPatch, X * (xxt * 2), Y * yyt, xxt, yyt,
     444        BitBltBitmapPrecise(OceanPatch, X * (xxt * 2), Y * yyt, xxt, yyt,
    445445          HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT, True);
    446         BitBltBitmap(OceanPatch, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
     446        BitBltBitmapPrecise(OceanPatch, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    447447          HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT, True);
    448448      end;
    449       BitBltBitmap(OceanPatch, X * (xxt * 2), Y * yyt, xxt, yyt,
     449      BitBltBitmapPrecise(OceanPatch, X * (xxt * 2), Y * yyt, xxt, yyt,
    450450        DitherMask, xxt, yyt, SRCAND, True);
    451       BitBltBitmap(OceanPatch, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
     451      BitBltBitmapPrecise(OceanPatch, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    452452        DitherMask, 0, yyt, SRCAND, True);
    453453    end;
     
    461461      ySrc := 1 + yyt;
    462462      if (X < 1) or (Y >= 2) then
    463         BitBltBitmap(OceanMore, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
     463        BitBltBitmapPrecise(OceanMore, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
    464464          HGrTerrain.Data, xSrc, ySrc, SRCCOPY, True);
    465465      if (X = 1) and (Y < 2) or (X >= 2) and (Y >= 1) then
    466466      begin
    467         BitBltBitmap(OceanMore, X * (xxt * 2), Y * yyt, xxt, yyt,
     467        BitBltBitmapPrecise(OceanMore, X * (xxt * 2), Y * yyt, xxt, yyt,
    468468          HGrTerrain.Data, xSrc + xxt, ySrc + yyt, SRCPAINT, True);
    469         BitBltBitmap(OceanMore, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
     469        BitBltBitmapPrecise(OceanMore, X * (xxt * 2) + xxt, Y * yyt, xxt, yyt,
    470470          HGrTerrain.Data, xSrc, ySrc + yyt, SRCPAINT, True);
    471471      end;
    472       BitBltBitmap(OceanMore, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
     472      BitBltBitmapPrecise(OceanMore, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
    473473        DitherMask, 0, 0, SRCAND, True);
    474474    end;
    475475  end;
    476476
    477   BitBltBitmap(DitherMask, 0, 0, xxt * 2, yyt * 2,
     477  BitBltBitmapPrecise(DitherMask, 0, 0, xxt * 2, yyt * 2,
    478478    DitherMask, 0, 0, DSTINVERT, True); { invert dither mask }
    479   BitBltBitmap(DitherMask, 0, 0, xxt * 2, yyt * 2,
     479  BitBltBitmapPrecise(DitherMask, 0, 0, xxt * 2, yyt * 2,
    480480    HGrTerrain.Mask, 1, 1 + yyt, SRCPAINT, True);
    481481
    482482  for X := -1 to 6 do
    483483    for Y := -2 to 6 do
    484       BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt,
     484      BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2), (Y + 2) * yyt,
    485485        xxt * 2, yyt, DitherMask, 0, 0, SRCAND, True);
    486486
    487487  for Y := -1 to 6 do
    488488    for X := -2 to 7 do
    489       BitBltBitmap(LandMore, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt,
     489      BitBltBitmapPrecise(LandMore, (X + 2) * (xxt * 2) - xxt, (Y + 2) * yyt,
    490490        xxt * 2, yyt, DitherMask, 0, yyt, SRCAND, True);
    491491
    492   BitBltBitmap(LandPatch, 0, 0, (xxt * 2) * 9, yyt * 9,
     492  BitBltBitmapPrecise(LandPatch, 0, 0, (xxt * 2) * 9, yyt * 9,
    493493    LandMore, 0, 0, SRCPAINT, True);
    494494
    495495  for X := 0 to 3 do
    496496    for Y := 0 to 3 do
    497       BitBltBitmap(OceanPatch, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
     497      BitBltBitmapPrecise(OceanPatch, X * (xxt * 2), Y * yyt, xxt * 2, yyt,
    498498        DitherMask, 0, 0, SRCAND, True);
    499499
    500500  for Y := 0 to 3 do
    501501    for X := 0 to 4 do
    502       BitBltBitmap(OceanMore, X * (xxt * 2) - xxt, Y * yyt, xxt * 2,
     502      BitBltBitmapPrecise(OceanMore, X * (xxt * 2) - xxt, Y * yyt, xxt * 2,
    503503        yyt, DitherMask, 0, yyt, SRCAND, True);
    504504
    505   BitBltBitmap(OceanPatch, 0, 0, (xxt * 2) * 4, yyt * 4, OceanMore, 0, 0,
     505  BitBltBitmapPrecise(OceanPatch, 0, 0, (xxt * 2) * 4, yyt * 4, OceanMore, 0, 0,
    506506    SRCPAINT, True);
    507507
     
    510510    FillRect(Rect(0, 0, xxt * 2, yyt));
    511511  end;
    512   BitBltBitmap(DitherMask, 0, 0, xxt * 2, yyt, HGrTerrain.Mask, 1, 1 + yyt,
     512  BitBltBitmapPrecise(DitherMask, 0, 0, xxt * 2, yyt, HGrTerrain.Mask, 1, 1 + yyt,
    513513    SRCCOPY, True);
    514514
    515515  for X := 0 to 6 do
    516     BitBltBitmap(LandPatch, (X + 2) * (xxt * 2), yyt, xxt * 2, yyt,
     516    BitBltBitmapPrecise(LandPatch, (X + 2) * (xxt * 2), yyt, xxt * 2, yyt,
    517517      DitherMask, 0, 0, SRCAND, True);
    518   BitBltBitmap(DitherMask, 0, 0, xxt * 2, yyt, DitherMask, 0, 0, DSTINVERT, True);
     518  BitBltBitmapPrecise(DitherMask, 0, 0, xxt * 2, yyt, DitherMask, 0, 0, DSTINVERT, True);
    519519
    520520  for Y := 0 to 6 do
    521     BitBltBitmap(LandPatch, xxt * 2, (Y + 2) * yyt, xxt * 2, yyt,
     521    BitBltBitmapPrecise(LandPatch, xxt * 2, (Y + 2) * yyt, xxt * 2, yyt,
    522522      DitherMask, 0, 0, SRCAND, True);
    523523
     
    626626
    627627  {$IFDEF DPI}
    628   BitBltBitmap(FOutput, X, Y, Width, Height, Src, xSrc, ySrc, Rop, Precise);
     628  BitBltBitmapPrecise(FOutput, X, Y, Width, Height, Src, xSrc, ySrc, Rop, Precise);
    629629  {$ELSE}
    630630  BitBltCanvas(FOutput.Canvas, X, Y, Width, Height, Src.Canvas, xSrc, ySrc, Rop);
     
    669669    Exit;
    670670
    671   BitBltBitmap(FOutput, xDst, yDst, Width, Height, HGrTerrain.Mask, xSrc, ySrc, SRCAND, Precise);
     671  BitBltBitmapPrecise(FOutput, xDst, yDst, Width, Height, HGrTerrain.Mask, xSrc, ySrc, SRCAND, Precise);
    672672  if not PureBlack then
    673     BitBltBitmap(FOutput, xDst, yDst, Width, Height, HGrTerrain.Data, xSrc, ySrc, SRCPAINT, Precise);
     673    BitBltBitmapPrecise(FOutput, xDst, yDst, Width, Height, HGrTerrain.Data, xSrc, ySrc, SRCPAINT, Precise);
    674674end;
    675675
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r589 r608  
    106106function ScaleToNativeDist(Base, Value: Integer): Integer;
    107107function ScaleFromNative(Value: Integer): Integer;
     108function BitBltBitmapPrecise(Dest: TBitmap; X, Y, Width, Height: Integer; Src: TBitmap;
     109  XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY; Precise: Boolean = False): Boolean;
    108110{$ENDIF}
    109111procedure UnshareBitmap(Bitmap: TBitmap);
     
    16831685  Result := Value;
    16841686end;
     1687
     1688function BitBltBitmapPrecise(Dest: TBitmap; X, Y, Width, Height: Integer; Src: TBitmap;
     1689  XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY; Precise: Boolean = False): Boolean;
     1690begin
     1691  Result := BitBltBitmap(Dest, X, Y, Width, Height, Src, XSrc, YSrc, Rop);
     1692end;
    16851693{$ENDIF}
    16861694
  • trunk/Packages/DpiControls/Dpi.Common.pas

    r568 r608  
    1414function BitBltCanvas(Dest: TCanvas; X, Y, Width, Height: Integer; Src: TCanvas;
    1515  XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY): Boolean;
    16 function BitBltBitmap(Dest: TBitmap; X, Y, Width, Height: Integer; Src: TBitmap;
     16function BitBltBitmapPrecise(Dest: TBitmap; X, Y, Width, Height: Integer; Src: TBitmap;
    1717  XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY; Precise: Boolean = False): Boolean;
    1818function CreateRectRgn(X1, Y1, X2, Y2: Integer): HRGN;
     
    5555end;
    5656
    57 function BitBltBitmap(Dest: TBitmap; X, Y, Width, Height: Integer;
     57function BitBltBitmapPrecise(Dest: TBitmap; X, Y, Width, Height: Integer;
    5858  Src: TBitmap; XSrc, YSrc: Integer; Rop: DWORD = SRCCOPY;
    5959  Precise: Boolean = False): Boolean;
     
    6464  DstPixelX, DstPixelY: Integer;
    6565  DstPixelWidth, DstPixelHeight: Integer;
    66   NewY: Integer;
    6766begin
    6867  if not Precise or (Frac(ScreenInfo.Dpi / 96) = 0) then begin
Note: See TracChangeset for help on using the changeset viewer.