Changeset 10 for trunk/UMainForm.pas


Ignore:
Timestamp:
Mar 19, 2011, 4:30:27 PM (14 years ago)
Author:
george
Message:
  • Modified: Optimized resampling of bitmap to higher resolution.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/UMainForm.pas

    r9 r10  
    77uses
    88  Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls,
    9   ComCtrls, Menus, ActnList, UCore;
     9  ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils;
    1010
    1111type
     
    4545    OriginalWindowState: TWindowState;
    4646    ScreenBounds: TRect;
     47    StartTime: TDateTime;
     48    DrawDuration: TDateTime;
     49    Drawing: Boolean;
    4750  public
    4851    { public declarations }
     
    6366procedure TMainForm.TimerDrawTimer(Sender: TObject);
    6467begin
     68  if not Drawing then
    6569  try
    66     TimerDraw.Enabled := False;
     70    Drawing := True;
     71    StartTime := NowPrecise;
    6772    Engine.Draw;
     73    DrawDuration := NowPrecise - StartTime;
    6874    StatusBar1.Panels[1].Text := IntToStr(TPlayer(Engine.Players[0]).Position.X) + ', ' +
    6975      IntToStr(TPlayer(Engine.Players[0]).Position.Y) + ' ' +
    7076      IntToStr(TPlayer(Engine.Players[0]).Direction);
     77    StatusBar1.Panels[2].Text := FloatToStr(RoundTo(DrawDuration / OneMillisecond, -2));
    7178  finally
    72     TimerDraw.Enabled := True;
     79    Drawing := False;
    7380  end;
    7481end;
Note: See TracChangeset for help on using the changeset viewer.