Ignore:
Timestamp:
Nov 22, 2012, 9:37:20 AM (12 years ago)
Author:
chronos
Message:
  • Modified: OpenGL methods could be disabled by compiler define opengl.
  • Fixed: Range check error in pixel assignment. Type Cardinal used instead of type Integer.
Location:
GraphicTest
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • GraphicTest

    • Property svn:ignore
      •  

        old new  
        77GraphicTest.rc
        88GraphicTest.lps
         9GraphicTest.dbg
  • GraphicTest/UFastBitmap.pas

    r356 r442  
    1010type
    1111
    12   TFastBitmapPixel = Integer;
     12  TFastBitmapPixel = Cardinal;
    1313  (*TFastBitmapPixel = record
    1414    Blue: Byte;
     
    7070  end;
    7171
    72 function SwapBRComponent(Value: Integer): Integer; inline;
    73 function NoSwapBRComponent(Value: Integer): Integer; inline;
     72function SwapBRComponent(Value: Cardinal): Cardinal; inline;
     73function NoSwapBRComponent(Value: Cardinal): Cardinal; inline;
    7474
    7575implementation
    7676
    77 function SwapBRComponent(Value: Integer): Integer;
     77function SwapBRComponent(Value: Cardinal): Cardinal;
    7878begin
    7979//  Result := (Value and $00ff00) or ((Value shr 16) and $ff) or ((Value and $ff) shl 16);
     
    8383end;
    8484
    85 function NoSwapBRComponent(Value: Integer): Integer;
     85function NoSwapBRComponent(Value: Cardinal): Cardinal;
    8686begin
    8787//  Result := (Value and $00ff00) or ((Value shr 16) and $ff) or ((Value and $ff) shl 16);
     
    211211    for Y := 0 to (Size.Y div 2) - 1 do
    212212      for X := 0 to (Size.X div 3) - 1 do
    213         Pixels[X + (I * (Size.X div 3)), Y] := 255 shl (I * 8);
     213        Pixels[X + (I * (Size.X div 3)), Y] := (255 shl (I * 8)) and $ffffff;
    214214
    215215  for Y := (Size.Y div 2) to Size.Y - 1 do
    216216    for X := 0 to Size.X - 1 do
    217       Pixels[X, Y] := Random(256) or (Random(256) shl 16) or (Random(256) shl 8);
     217      Pixels[X, Y] := (Random(256) or (Random(256) shl 16) or (Random(256) shl 8)) and $ffffff;
    218218end;
    219219
Note: See TracChangeset for help on using the changeset viewer.