Changeset 21 for trunk/ScreenTools.pas


Ignore:
Timestamp:
Jan 8, 2017, 3:12:18 PM (7 years ago)
Author:
chronos
Message:
  • Fixed: Run as 64-bit application. Can't load 32-bit StdAI library in 64-bit mode.
  • Fixed: Various Warnings and Hints.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ScreenTools.pas

    r20 r21  
    99  {$ENDIF}
    1010  StringTables,
    11   LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls,
     11  LCLIntf, LCLType, SysUtils, Classes, Graphics, Controls,
    1212  Forms, Menus;
    1313
     
    192192
    193193uses
    194   Directories, Sound, ButtonBase, ButtonA, ButtonB,
    195 
    196   Registry;
     194  Directories, Sound, Registry;
    197195
    198196var
     
    386384procedure ApplyGamma(Start, Stop: pbyte);
    387385begin
    388   while integer(Start) < integer(Stop) do
     386  while Start < Stop do
    389387  begin
    390388    Start^ := GammaLUT[Start^];
     
    443441    FirstLine := bmp.ScanLine[0];
    444442    LastLine := bmp.ScanLine[bmp.Height - 1];
    445     if integer(FirstLine) < integer(LastLine) then
     443    if FirstLine < LastLine then
    446444      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    447445    else
     
    501499    FirstLine := bmp.ScanLine[0];
    502500    LastLine := bmp.ScanLine[bmp.Height - 1];
    503     if integer(FirstLine) < integer(LastLine) then
     501    if FirstLine < LastLine then
    504502      ApplyGamma(pointer(FirstLine), @LastLine[bmp.Width])
    505503    else
     
    612610// X channel = background amp (old Dst content), 128=original brightness
    613611type
    614   TPixel = array [0 .. 2] of Byte;
     612  TPixel = array [0..2] of Byte;
     613  PPixel = ^TPixel;
    615614var
    616615  i, Brightness, test: integer;
    617616  PixelSrc: ^Byte;
    618   PixelDst: ^TPixel;
     617  PixelDst: PPixel;
    619618begin
    620619  {TODO assert(Src.PixelFormat = pf8bit);}
     
    642641  while yDst < h do
    643642  begin
    644     PixelDst := pointer(integer(dst.ScanLine[yDst]) + 3 * xDst);
    645     PixelSrc := pointer(integer(Src.ScanLine[ySrc]) + xSrc);
     643    PixelDst := dst.ScanLine[yDst] + 3 * xDst;
     644    PixelSrc := Src.ScanLine[ySrc] + xSrc;
    646645    for i := 0 to w - 1 do
    647646    begin
     
    662661      else
    663662        PixelDst[0] := test; // Blue
    664       PixelDst := pointer(integer(PixelDst) + 3);
    665       PixelSrc := pointer(integer(PixelSrc) + 1);
     663      PixelDst := Pointer(PixelDst) + 3;
     664      PixelSrc := Pointer(PixelSrc) + 1;
    666665    end;
    667666    inc(yDst);
     
    751750  while y < h do
    752751  begin
    753     Pixel := pointer(integer(bmp.ScanLine[y]) + 3 * x);
     752    Pixel := bmp.ScanLine[y] + 3 * x;
    754753    for i := 0 to w - 1 do
    755754    begin
     
    764763      Pixel[1] := Green;
    765764      Pixel[2] := Red;
    766       Pixel := pointer(integer(Pixel) + 3);
     765      Pixel := Pointer(Pixel) + 3;
    767766    end;
    768767    inc(y);
Note: See TracChangeset for help on using the changeset viewer.