Changeset 11 for trunk/Forms


Ignore:
Timestamp:
Aug 29, 2016, 6:09:30 PM (8 years ago)
Author:
chronos
Message:
  • Modified: Slightly optimizied screen drawing.
Location:
trunk/Forms
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.lfm

    r10 r11  
    5656  end
    5757  object Timer1: TTimer
    58     Interval = 50
     58    Interval = 10
    5959    OnTimer = Timer1Timer
    6060    left = 180
  • trunk/Forms/UFormMain.pas

    r10 r11  
    178178var
    179179  X, Y: Integer;
     180  DX, DY: Integer;
    180181  Bitmap: TBitmap;
     182  P, PR: PByte;
    181183begin
    182184  try
     
    186188
    187189    if Assigned(VideoDevice.VideoMemory) then begin
    188       for Y := 0 to VideoDevice.VideoMode.Size.Y - 1 do
    189       for X := 0 to VideoDevice.VideoMode.Size.X - 1 do begin
    190         Bitmap.Canvas.Pixels[X, Y] := PInteger(VideoDevice.VideoMemory + X * VideoDevice.VideoMode.GetBytesPerPixel +
    191         Y * VideoDevice.VideoMode.GetBytesPerLine)^ and $ffffff;
     190      DX := VideoDevice.VideoMode.GetBytesPerPixel;
     191      DY := VideoDevice.VideoMode.GetBytesPerLine;
     192      P := VideoDevice.VideoMemory;
     193      for Y := 0 to VideoDevice.VideoMode.Size.Y - 1 do begin
     194        PR := P;
     195        for X := 0 to VideoDevice.VideoMode.Size.X - 1 do begin
     196          Bitmap.Canvas.Pixels[X, Y] := PInteger(PR)^ and $ffffff;
     197          Inc(PR, DX);
     198        end;
     199        Inc(P, DY);
    192200      end;
    193201    end;
Note: See TracChangeset for help on using the changeset viewer.