Ignore:
Timestamp:
Jan 8, 2017, 11:21:02 AM (7 years ago)
Author:
chronos
Message:
  • Fixed: Build under Linux.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/Term.pas

    r15 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Term;
    33
     
    55
    66uses
    7   Windows, Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
     7  Protocol, Tribes, PVSB, ClientTools, ScreenTools, BaseWin, Messg, ButtonBase,
    88
    99  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, Menus,
    10   ExtCtrls,
     10  ExtCtrls, dateutils, Platform,
    1111  ButtonA, ButtonB, ButtonC, EOTButton, Area;
    1212
     
    480480  Jump: array [0 .. nPl - 1] of integer;
    481481  pTurn, pLogo, UnStartLoc, ToldSlavery: integer;
    482   PerfFreq: int64;
    483482  SmallScreen, GameOK, MapValid, skipped, idle: boolean;
    484483
     
    42054204      offscreen.Canvas.Font.Assign(UniFont[ftSmall]);
    42064205      rec := Rect(0, 0, MapWidth, MapHeight);
     4206      {$IFDEF WINDOWS}{TODO Linux}
    42074207      ScrollDC(offscreen.Canvas.Handle, (xwd - xw) * (xxt * 2),
    42084208        (ywd - yw) * yyt, rec, rec, 0, nil);
     4209      {$ENDIF}
    42094210      for DoInvalidate := false to FastScrolling do
    42104211      begin
     
    42124213        begin
    42134214          rec.Bottom := MapHeight - overlap;
     4215          {$IFDEF WINDOWS}{TODO Linux}
    42144216          ScrollDC(Canvas.Handle, (xwd - xw) * (xxt * 2), (ywd - yw) * yyt, rec,
    42154217            rec, 0, nil);
     4218          {$ENDIF}
    42164219          ProcessOptions := prInvalidate;
    42174220        end
     
    60096012      SliceCount: integer;
    60106013    UnitInfo: TUnitInfo;
    6011     Ticks0, Ticks: int64;
     6014    Ticks0, Ticks: TDateTime;
    60126015  begin
    60136016    Timer1.Enabled := false;
    6014     QueryPerformanceCounter(Ticks0);
     6017    Ticks0 := NowPrecise;
    60156018    with ShowMove do
    60166019    begin
     
    60956098        Ticks := Ticks0;
    60966099        repeat
    6097           if (SliceCount = 0) or ((Ticks - Ticks0) * 12000 * (SliceCount + 1)
    6098             div SliceCount < MoveTime * PerfFreq) then
     6100          if (SliceCount = 0) or (MillisecondOf(Ticks - Ticks0) * 12 * (SliceCount + 1)
     6101            div SliceCount < MoveTime) then
    60996102          begin
    61006103            if not idle or (GameMode = cMovie) then
     
    61036106            inc(SliceCount)
    61046107          end;
    6105           QueryPerformanceCounter(Ticks);
    6106         until (Ticks - Ticks0) * 12000 >= MoveTime * PerfFreq;
     6108          Ticks := NowPrecise;
     6109        until MillisecondOf(Ticks - Ticks0) * 12 >= MoveTime;
    61076110        Ticks0 := Ticks
    61086111      end;
     
    64666469    var
    64676470      dx, dy: integer;
    6468       time0, time1: int64;
     6471      time0, time1: TDateTime;
    64696472    begin
    64706473      if GameMode = cMovie then
     
    65516554          ' ':
    65526555            begin // test map repaint time
    6553               QueryPerformanceCounter(time0);
     6556              time0 := NowPrecise;
    65546557              MapValid := false;
    65556558              MainOffscreenPaint;
    6556               QueryPerformanceCounter(time1);
     6559              time1 := NowPrecise;
    65576560              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)]));
    65606562            end
    65616563        end
     
    80388040initialization
    80398041
    8040 QueryPerformanceFrequency(PerfFreq);
    8041 
    80428042end.
Note: See TracChangeset for help on using the changeset viewer.