Changeset 17 for trunk/LocalPlayer


Ignore:
Timestamp:
Jan 8, 2017, 11:21:02 AM (8 years ago)
Author:
chronos
Message:
  • Fixed: Build under Linux.
Location:
trunk/LocalPlayer
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • trunk/LocalPlayer/BaseWin.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit BaseWin;
    33
  • trunk/LocalPlayer/Battle.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit Battle;
    33
     
    55
    66uses
    7   ScreenTools, Protocol, Messg, ButtonBase, ButtonA,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms;
     7  ScreenTools, Protocol, Messg, ButtonBase, ButtonA, Types, LCLIntf, LCLType,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms;
    1010
    1111type
     
    3939  Term, ClientTools, IsoEngine;
    4040
    41 {$R *.DFM}
     41{$R *.dfm}
    4242
    4343const
  • trunk/LocalPlayer/CityScreen.pas

    r12 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit CityScreen;
    33
  • trunk/LocalPlayer/CityType.pas

    r10 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit CityType;
    33
     
    55
    66uses
    7   Protocol, ClientTools, Term, ScreenTools, BaseWin,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     7  Protocol, ClientTools, Term, ScreenTools, BaseWin, LCLIntf, LCLType,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms,
    1010  ButtonB, ExtCtrls, ButtonA, ButtonBase;
    1111
     
    4444uses Help;
    4545
    46 {$R *.DFM}
     46{$R *.dfm}
    4747
    4848const
     
    345345  listed := [];
    346346  Changed := true;
    347   SmartUpdateContent
     347  SmartUpdateContent;
    348348end;
    349349
  • trunk/LocalPlayer/ClientTools.pas

    r10 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit ClientTools;
    33
  • trunk/LocalPlayer/Diagram.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Diagram;
    33
  • trunk/LocalPlayer/Diplomacy.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit Diplomacy;
    33
  • trunk/LocalPlayer/Draft.pas

    r12 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Draft;
    33
  • trunk/LocalPlayer/Enhance.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit Enhance;
    33
     
    55
    66uses
    7   ScreenTools, BaseWin, Protocol, ClientTools, Term,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     7  ScreenTools, BaseWin, Protocol, ClientTools, Term, LCLIntf, LCLType,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms,
    1010  ButtonBase, ButtonB, ButtonC, Menus;
    1111
     
    4545uses Help;
    4646
    47 {$R *.DFM}
     47{$R *.dfm}
    4848
    4949procedure TEnhanceDlg.FormCreate(Sender: TObject);
  • trunk/LocalPlayer/Help.pas

    r12 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Help;
    33
     
    9393    procedure Search(SearchString: string);
    9494    procedure OnScroll(var m: TMessage); message WM_VSCROLL;
    95     procedure OnMouseWheel(var m: TMessage); message WM_MOUSEWHEEL;
     95    procedure OnMouseWheel(var m: TMessage); message LM_MOUSEWHEEL;
    9696    procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
    9797  end;
  • trunk/LocalPlayer/IsoEngine.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit IsoEngine;
    33
  • trunk/LocalPlayer/LocalPlayer.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit LocalPlayer;
    33
  • trunk/LocalPlayer/MessgEx.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit MessgEx;
    33
     
    55
    66uses
    7   Messg, Protocol, ScreenTools, Windows,
     7  Messg, Protocol, ScreenTools, Platform, DateUtils,
    88
    99  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
     
    8282  LostUnitsPerLine = 6;
    8383
    84 var
    85   PerfFreq: int64;
    86 
    8784procedure TMessgExDlg.FormCreate(Sender: TObject);
    8885begin
     
    203200function TMessgExDlg.ShowModal: integer;
    204201var
    205   Ticks0, Ticks: int64;
     202  Ticks0, Ticks: TDateTime;
    206203begin
    207204  if GameMode = cMovie then
     
    211208      MovieCancelled := false;
    212209      Show;
    213       QueryPerformanceCounter(Ticks0);
     210      Ticks0 := NowPrecise;
    214211      repeat
    215212        Application.ProcessMessages;
    216213        Sleep(1);
    217         QueryPerformanceCounter(Ticks);
    218       until MovieCancelled or ((Ticks - Ticks0) * 1000 >= 1500 * PerfFreq);
     214        Ticks := NowPrecise;
     215      until MovieCancelled or (MillisecondOf(Ticks - Ticks0) >= 1500);
    219216      Hide;
    220217    end;
     
    563560initialization
    564561
    565 QueryPerformanceFrequency(PerfFreq);
    566 
    567562end.
  • trunk/LocalPlayer/NatStat.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit NatStat;
    33
  • trunk/LocalPlayer/Nego.pas

    r12 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Nego;
    33
     
    55
    66uses
    7   ScreenTools, BaseWin, Protocol, Term,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
     7  ScreenTools, BaseWin, Protocol, Term, LCLType,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms, ButtonA,
    1010  ButtonBase, ButtonB, ButtonC, ButtonN;
    1111
     
    103103  Messg, ClientTools, Diplomacy, Inp, Select, NatStat, Help, Tribes, MessgEx;
    104104
    105 {$R *.DFM}
     105{$R *.dfm}
    106106
    107107const
  • trunk/LocalPlayer/PVSB.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit PVSB;
    33
     
    55
    66uses
    7   Windows, LCLIntf, LCLType, LMessages, Messages, SysUtils;
     7  LCLIntf, LCLType, LMessages, Messages, SysUtils;
    88
    99type
     
    2828begin
    2929  inc(Count);
     30  {$IFDEF WINDOWS}
    3031  sb.h := CreateWindowEx(0, 'SCROLLBAR', pchar('PVSB' + IntToStr(Count)),
    3132    SBS_VERT or WS_CHILD or SBS_RIGHTALIGN, x1 - 100, y0, 100, y1 - y0,
    3233    Handle, 0, 0, nil);
     34  {$ENDIF}
    3335  sb.si.cbSize := 28;
    3436end;
     
    6062    else
    6163    begin
    62       if m.wParamLo in [SB_THUMBPOSITION, SB_THUMBTRACK] then
     64      if (m.wParam and $ffff) in [SB_THUMBPOSITION, SB_THUMBTRACK] then
    6365      begin
    64         result := m.wParamHi <> npos;
    65         npos := m.wParamHi;
     66        result := ((m.wParam shr 16) and $ffff) <> npos;
     67        npos := (m.wParam shr 16) and $ffff;
    6668      end
    6769      else
    6870      begin
    69         case m.wParamLo of
     71        case (m.wParam and $ffff) of
    7072          SB_LINEUP:
    7173            NewPos := npos - 1;
     
    8486          NewPos := nMax - integer(nPage) + 1;
    8587        result := NewPos <> npos;
    86         if (NewPos <> npos) or (m.wParamLo = SB_ENDSCROLL) then
     88        if (NewPos <> npos) or ((m.wParam and $ffff) = SB_ENDSCROLL) then
    8789        begin
    8890          npos := NewPos;
  • trunk/LocalPlayer/Rates.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit Rates;
    33
     
    55
    66uses
    7   Protocol, ScreenTools, BaseWin,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     7  Protocol, ScreenTools, BaseWin, LCLIntf, LCLType,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms,
    1010  ButtonBase, ButtonB, ButtonC;
    1111
     
    3434  ClientTools, Term, Tribes;
    3535
    36 {$R *.DFM}
     36{$R *.dfm}
    3737
    3838const
  • trunk/LocalPlayer/Select.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Select;
    33
     
    6969    function RenameModel(mix: integer): boolean;
    7070    procedure OnScroll(var m: TMessage); message WM_VSCROLL;
    71     procedure OnMouseWheel(var m: TMessage); message WM_MOUSEWHEEL;
     71    procedure OnMouseWheel(var m: TMessage); message LM_MOUSEWHEEL;
    7272    procedure OnMouseLeave(var Msg: TMessage); message CM_MOUSELEAVE;
    7373  end;
  • trunk/LocalPlayer/TechTree.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit TechTree;
    33
     
    55
    66uses
    7   ScreenTools, Messg,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     7  ScreenTools, Messg, LCLIntf, LCLType,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms,
    1010  ButtonBase, ButtonB;
    1111
     
    3737  Directories;
    3838
    39 {$R *.DFM}
     39{$R *.dfm}
    4040
    4141const
  • 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.
  • trunk/LocalPlayer/Tribes.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit Tribes;
    33
  • trunk/LocalPlayer/UnitStat.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit UnitStat;
    33
  • trunk/LocalPlayer/Wonders.pas

    r9 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22unit Wonders;
    33
Note: See TracChangeset for help on using the changeset viewer.