Changeset 17 for trunk/LocalPlayer/Term.pas
- Timestamp:
- Jan 8, 2017, 11:21:02 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LocalPlayer/Term.pas
r15 r17 1 {$INCLUDE switches.pas}1 {$INCLUDE Switches.pas} 2 2 unit Term; 3 3 … … 5 5 6 6 uses 7 Windows,Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,7 Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase, 8 8 9 9 LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus, 10 ExtCtrls, 10 ExtCtrls, dateutils, Platform, 11 11 ButtonA, ButtonB, ButtonC, EOTButton, Area; 12 12 … … 480 480 Jump: array [0 .. nPl - 1] of integer; 481 481 pTurn, pLogo, UnStartLoc, ToldSlavery: integer; 482 PerfFreq: int64;483 482 SmallScreen, GameOK, MapValid, skipped, idle: boolean; 484 483 … … 4205 4204 offscreen.Canvas.Font.Assign(UniFont[ftSmall]); 4206 4205 rec := Rect(0, 0, MapWidth, MapHeight); 4206 {$IFDEF WINDOWS}{TODO Linux} 4207 4207 ScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2), 4208 4208 (ywd - yw) * yyt, rec, rec, 0, nil); 4209 {$ENDIF} 4209 4210 for DoInvalidate := false to FastScrolling do 4210 4211 begin … … 4212 4213 begin 4213 4214 rec.Bottom := MapHeight - overlap; 4215 {$IFDEF WINDOWS}{TODO Linux} 4214 4216 ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec, 4215 4217 rec, 0, nil); 4218 {$ENDIF} 4216 4219 ProcessOptions := prInvalidate; 4217 4220 end … … 6009 6012 SliceCount: integer; 6010 6013 UnitInfo: TUnitInfo; 6011 Ticks0, Ticks: int64;6014 Ticks0, Ticks: TDateTime; 6012 6015 begin 6013 6016 Timer1.Enabled := false; 6014 QueryPerformanceCounter(Ticks0);6017 Ticks0 := NowPrecise; 6015 6018 with ShowMove do 6016 6019 begin … … 6095 6098 Ticks := Ticks0; 6096 6099 repeat 6097 if (SliceCount = 0) or ( (Ticks - Ticks0) * 12000* (SliceCount + 1)6098 div SliceCount < MoveTime * PerfFreq) then6100 if (SliceCount = 0) or (MillisecondOf(Ticks - Ticks0) * 12 * (SliceCount + 1) 6101 div SliceCount < MoveTime) then 6099 6102 begin 6100 6103 if not idle or (GameMode = cMovie) then … … 6103 6106 inc(SliceCount) 6104 6107 end; 6105 QueryPerformanceCounter(Ticks);6106 until (Ticks - Ticks0) * 12000 >= MoveTime * PerfFreq;6108 Ticks := NowPrecise; 6109 until MillisecondOf(Ticks - Ticks0) * 12 >= MoveTime; 6107 6110 Ticks0 := Ticks 6108 6111 end; … … 6466 6469 var 6467 6470 dx, dy: integer; 6468 time0, time1: int64;6471 time0, time1: TDateTime; 6469 6472 begin 6470 6473 if GameMode = cMovie then … … 6551 6554 ' ': 6552 6555 begin // test map repaint time 6553 QueryPerformanceCounter(time0);6556 time0 := NowPrecise; 6554 6557 MapValid := false; 6555 6558 MainOffscreenPaint; 6556 QueryPerformanceCounter(time1);6559 time1 := NowPrecise; 6557 6560 SimpleMessage(Format('Map repaint time: %.3f ms', 6558 [{$IFDEF VER100}(time1.LowPart - time0.LowPart) 6559 {$ELSE}(time1 - time0){$ENDIF} * 1000.0 / PerfFreq])); 6561 [MillisecondOf(time1 - time0)])); 6560 6562 end 6561 6563 end … … 8038 8040 initialization 8039 8041 8040 QueryPerformanceFrequency(PerfFreq);8041 8042 8042 end.
Note:
See TracChangeset
for help on using the changeset viewer.