Changeset 73 for trunk/Forms/UFormMain.pas
- Timestamp:
- Oct 4, 2014, 9:05:59 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.pas
r72 r73 95 95 RedrawPending: Boolean; 96 96 DrawDuration: TDateTime; 97 LastTimerTime: TDateTime; 98 TimerPeriod: TDateTime; 97 99 public 98 100 procedure LoadConfig(Config: TXmlConfig; Path: string); … … 122 124 begin 123 125 DrawStart := Now; 124 //if Core.Game.Running then125 126 if Assigned(Core.Game.CurrentPlayer) then 126 127 with Core.Game.CurrentPlayer do begin … … 132 133 Paint(TempBitmap.Canvas); 133 134 PaintBox1.Canvas.Draw(0, 0, TempBitmap); 134 end else Paint(PaintBox1.Canvas); 135 end; 136 DrawDuration := Now - DrawStart; 135 end else begin 136 Paint(PaintBox1.Canvas); 137 end; 138 end; 139 DrawDuration := (9 * DrawDuration + (Now - DrawStart)) / 10; 137 140 end; 138 141 … … 153 156 var 154 157 NewCaption: string; 155 DrawStart: TDateTime;156 158 begin 157 159 if RedrawPending then begin 158 160 RedrawPending := False; 161 TimerPeriod := (9 * TimerPeriod + (Now - LastTimerTime)) / 10; 162 LastTimerTime := Now; 159 163 PaintBox1.Repaint; 160 StatusBar1.Panels[1].Text := IntToStr(Trunc(DrawDuration / OneMillisecond)) + ' ms'; 164 StatusBar1.Panels[1].Text := IntToStr(Trunc(DrawDuration / OneMillisecond)) + ' / ' + 165 IntToStr(Trunc(TimerPeriod / OneMillisecond)) + ' ms'; 161 166 NewCaption := 'xTactics'; 162 167 if Assigned(Core.Game.CurrentPlayer) then … … 213 218 //DoubleBuffered := True; 214 219 TempBitmap := TBitmap.Create; 220 TimerPeriod := 0; 221 LastTimerTime := Now; 215 222 end; 216 223
Note:
See TracChangeset
for help on using the changeset viewer.