Ignore:
Timestamp:
Mar 26, 2021, 3:24:15 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Player border tile preparation code for bitmap color replacement moved to ScreenTools.
File:
1 edited

Legend:

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

    r230 r331  
    99  TColor32 = type Cardinal;
    1010  TColor32Component = (ccBlue, ccGreen, ccRed, ccAlpha);
     11
     12  { TPixel32 }
     13
    1114  TPixel32 = packed record
     15  private
     16    function GetRGB: Cardinal;
     17    procedure SetRGB(AValue: Cardinal);
     18  public
     19    property RGB: Cardinal read GetRGB write SetRGB;
    1220    case Integer of
    1321      0: (B, G, R, A: Byte);
     
    3745
    3846  function PixelPointer(Bitmap: TRasterImage; BaseX: Integer = 0; BaseY: Integer = 0): TPixelPointer; inline;
    39 
     47  function SwapRedBlue(Color: TColor32): TColor32;
    4048
    4149implementation
     50
     51{ TPixel32 }
     52
     53function TPixel32.GetRGB: Cardinal;
     54begin
     55  Result := ARGB and $ffffff;
     56end;
     57
     58procedure TPixel32.SetRGB(AValue: Cardinal);
     59begin
     60  R := (AValue shr 16) and $ff;
     61  G := (AValue shr 8) and $ff;
     62  B := (AValue shr 0) and $ff;
     63end;
    4264
    4365{ TPixelPointer }
     
    86108end;
    87109
     110function SwapRedBlue(Color: TColor32): TColor32;
     111begin
     112  Result := (Color and $ff00ff00) or ((Color and $ff) shl 16) or ((Color shr 16) and $ff);
     113end;
     114
    88115
    89116end.
Note: See TracChangeset for help on using the changeset viewer.