Changeset 10 for trunk/UMainForm.pas
- Timestamp:
- Mar 19, 2011, 4:30:27 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UMainForm.pas
r9 r10 7 7 uses 8 8 Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ExtCtrls, 9 ComCtrls, Menus, ActnList, UCore ;9 ComCtrls, Menus, ActnList, UCore, UPlatform, Math, DateUtils; 10 10 11 11 type … … 45 45 OriginalWindowState: TWindowState; 46 46 ScreenBounds: TRect; 47 StartTime: TDateTime; 48 DrawDuration: TDateTime; 49 Drawing: Boolean; 47 50 public 48 51 { public declarations } … … 63 66 procedure TMainForm.TimerDrawTimer(Sender: TObject); 64 67 begin 68 if not Drawing then 65 69 try 66 TimerDraw.Enabled := False; 70 Drawing := True; 71 StartTime := NowPrecise; 67 72 Engine.Draw; 73 DrawDuration := NowPrecise - StartTime; 68 74 StatusBar1.Panels[1].Text := IntToStr(TPlayer(Engine.Players[0]).Position.X) + ', ' + 69 75 IntToStr(TPlayer(Engine.Players[0]).Position.Y) + ' ' + 70 76 IntToStr(TPlayer(Engine.Players[0]).Direction); 77 StatusBar1.Panels[2].Text := FloatToStr(RoundTo(DrawDuration / OneMillisecond, -2)); 71 78 finally 72 TimerDraw.Enabled := True;79 Drawing := False; 73 80 end; 74 81 end;
Note:
See TracChangeset
for help on using the changeset viewer.