Changeset 73
- Timestamp:
- Oct 4, 2014, 9:05:59 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Forms/UFormMain.lfm
r71 r73 1 1 object FormMain: TFormMain 2 Left = 2782 Left = 490 3 3 Height = 621 4 Top = 844 Top = 358 5 5 Width = 775 6 6 Caption = 'xTactics' 7 ClientHeight = 59 57 ClientHeight = 592 8 8 ClientWidth = 775 9 9 Menu = MainMenu1 … … 15 15 LCLVersion = '1.3' 16 16 WindowState = wsMaximized 17 object PaintBox1: TPaintBox18 Left = 4019 Height = 56920 Top = 021 Width = 73522 Align = alClient23 ParentColor = False24 OnMouseDown = PaintBox1MouseDown25 OnMouseMove = PaintBox1MouseMove26 OnMouseUp = PaintBox1MouseUp27 OnMouseLeave = PaintBox1MouseLeave28 OnMouseWheelDown = PaintBox1MouseWheelDown29 OnMouseWheelUp = PaintBox1MouseWheelUp30 OnPaint = PaintBox1Paint31 OnResize = PaintBox1Resize32 end33 17 object StatusBar1: TStatusBar 34 18 Left = 0 35 Height = 2 636 Top = 56 919 Height = 29 20 Top = 563 37 21 Width = 775 38 22 Panels = < 39 23 item 40 Width = 10024 Width = 200 41 25 end 42 26 item 43 Width = 1 0027 Width = 150 44 28 end 45 29 item … … 50 34 object ToolBar1: TToolBar 51 35 Left = 0 52 Height = 56 936 Height = 563 53 37 Top = 0 54 38 Width = 40 … … 109 93 end 110 94 end 95 object PaintBox1: TPaintBox 96 Left = 40 97 Height = 563 98 Top = 0 99 Width = 735 100 Align = alClient 101 OnMouseDown = PaintBox1MouseDown 102 OnMouseMove = PaintBox1MouseMove 103 OnMouseUp = PaintBox1MouseUp 104 OnMouseLeave = PaintBox1MouseLeave 105 OnMouseWheelDown = PaintBox1MouseWheelDown 106 OnMouseWheelUp = PaintBox1MouseWheelUp 107 OnPaint = PaintBox1Paint 108 OnResize = PaintBox1Resize 109 end 111 110 object MainMenu1: TMainMenu 112 111 Images = Core.ImageListSmall … … 178 177 end 179 178 object Timer1: TTimer 180 Interval = 20179 Interval = 10 181 180 OnTimer = Timer1Timer 182 181 left = 154 -
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 -
trunk/xtactics.lpi
r70 r73 111 111 <HasResources Value="True"/> 112 112 <ResourceBaseClass Value="Form"/> 113 <UnitName Value="UFormPlayer"/> 113 114 </Unit3> 114 115 <Unit4> … … 134 135 <HasResources Value="True"/> 135 136 <ResourceBaseClass Value="Form"/> 136 <UnitName Value="UFormMove"/>137 137 </Unit6> 138 138 <Unit7>
Note:
See TracChangeset
for help on using the changeset viewer.