Ignore:
Timestamp:
May 7, 2020, 10:33:59 AM (5 years ago)
Author:
chronos
Message:
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r189 r190  
    8181function SetMainTextureByAge(Age: integer): boolean;
    8282procedure LoadPhrases;
     83procedure Texturize(Dest, Texture: TBitmap; TransparentColor: Integer);
    8384
    8485const
     
    13981399end;
    13991400
     1401procedure Texturize(Dest, Texture: TBitmap; TransparentColor: Integer);
     1402var
     1403  SrcPixel, DstPixel: TPixelPointer;
     1404  X, Y: Integer;
     1405  TexWidth, TexHeight: Integer;
     1406begin
     1407  // texturize background
     1408  Dest.BeginUpdate;
     1409  TexWidth := Texture.Width;
     1410  TexHeight := Texture.Height;
     1411  DstPixel.Init(Dest);
     1412  SrcPixel.Init(Texture);
     1413  for Y := 0 to Dest.Height - 1 do begin
     1414    for X := 0 to Dest.Width - 1 do begin
     1415      if (DstPixel.Pixel^.ARGB and $FFFFFF) = TransparentColor then begin
     1416        SrcPixel.SetXY(X mod TexWidth, Y mod TexHeight);
     1417        DstPixel.Pixel^.B := SrcPixel.Pixel^.B;
     1418        DstPixel.Pixel^.G := SrcPixel.Pixel^.G;
     1419        DstPixel.Pixel^.R := SrcPixel.Pixel^.R;
     1420      end;
     1421      DstPixel.NextPixel;
     1422    end;
     1423    DstPixel.NextLine;
     1424  end;
     1425  Dest.EndUpdate;
     1426end;
     1427
    14001428procedure LoadFonts;
    14011429var
Note: See TracChangeset for help on using the changeset viewer.