Ignore:
Timestamp:
Jan 11, 2017, 10:14:11 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: More Bitmap.ScanLine replaced by direct access to RAWImage data.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/TechTree.pas

    r38 r52  
    120120
    121121procedure TTechTreeDlg.FormShow(Sender: TObject);
    122 type
    123   TLine = array [0 .. 9999, 0 .. 2] of Byte;
    124122var
    125123  X, Y, ad, TexWidth, TexHeight: Integer;
    126124  s: string;
    127   SrcLine, DstLine: ^TLine;
     125  SrcPixel, DstPixel: PPixel32;
    128126begin
    129127  if Image = nil then
     
    171169    for Y := 0 to Image.height - 1 do
    172170    begin
    173       SrcLine := Paper.ScanLine[Y mod TexHeight];
    174       DstLine := Image.ScanLine[Y];
    175171      for X := 0 to Image.width - 1 do
    176172      begin
    177         if Cardinal((@DstLine[X])^) and $FFFFFF = $7F007F then // transparent
    178           DstLine[X] := SrcLine[X mod TexWidth];
     173        DstPixel := GetBitmapPixelPtr(Image, X, Y);
     174        if (DstPixel^.ARGB and $FFFFFF) = $7F007F then // transparent
     175        begin
     176          SrcPixel := GetBitmapPixelPtr(Paper, X mod TexWidth, Y mod TexHeight);
     177          DstPixel^.B := SrcPixel^.B;
     178          DstPixel^.G := SrcPixel^.G;
     179          DstPixel^.R := SrcPixel^.R;
     180        end;
    179181      end;
    180182    end;
Note: See TracChangeset for help on using the changeset viewer.