Changeset 17 for trunk


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

Legend:

Unmodified
Added
Removed
  • trunk/CityProcessing.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches}
    22unit CityProcessing;
    33
  • trunk/CmdList.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches}
    22unit CmdList;
    33
  • trunk/GameServer.pas

    r10 r17  
    77
    88uses
    9   Protocol, Database, dynlibs, Windows;
     9  Protocol, Database, dynlibs, Platform, dateutils;
    1010
    1111const
     
    127127  AIInfo: array [0 .. nPl - 1] of string;
    128128  Notify: TNotifyFunction;
    129   PerfFreq, LastClientTime: int64;
     129  LastClientTime: TDateTime;
    130130{$IFOPT O-}HandoverStack: array [0 .. 31] of Cardinal; {$ENDIF}
    131131  AutoSaveExists, LoadOK, WinOnAlone, PreviewElevation, MovieStopped: boolean;
     
    320320var
    321321  p: integer;
    322   T: int64;
     322  T: TDateTime;
    323323begin
    324   QueryPerformanceCounter(T);
     324  T := NowPrecise;
    325325  PutMessage(1 shl 16 + 2, Format('CLIENT: took %.1f ms',
    326     [{$IFDEF VER100}(T.LowPart - LastClientTime.LowPart)
    327 {$ELSE}(T - LastClientTime){$ENDIF} * 1000.0 / PerfFreq]));
     326    [MilliSecondOf(T - LastClientTime)]));
    328327  LastClientTime := T;
    329328  PutMessage(1 shl 16 + 2, Format('CLIENT: calling %d (%s)',
     
    44724471initialization
    44734472
    4474 QueryPerformanceFrequency(PerfFreq);
    44754473FindFirst(ParamStr(0), $21, ExeInfo);
    44764474
  • trunk/IPQ.pas

    r2 r17  
    22code contributed by Rassim Eminli}
    33
    4 {$INCLUDE switches.pas}
     4{$INCLUDE Switches.pas}
    55
    66unit IPQ;
  • trunk/Integrated.lpi

    r15 r17  
    8686      </Item2>
    8787    </RequiredPackages>
    88     <Units Count="41">
     88    <Units Count="42">
    8989      <Unit0>
    9090        <Filename Value="Integrated.lpr"/>
     
    309309        <HasResources Value="True"/>
    310310      </Unit40>
     311      <Unit41>
     312        <Filename Value="Platform.pas"/>
     313        <IsPartOfProject Value="True"/>
     314      </Unit41>
    311315    </Units>
    312316  </ProjectOptions>
     
    338342        <StackChecks Value="True"/>
    339343      </Checks>
    340       <VerifyObjMethodCallValidity Value="True"/>
    341       <TargetCPU Value="i386"/>
    342       <TargetOS Value="win32"/>
    343344    </CodeGeneration>
    344345    <Linking>
  • trunk/Integrated.lpr

    r10 r17  
    4545  TechTree in 'LocalPlayer\TechTree.pas' {TechTreeDlg};
    4646
    47 {$R cevo.RES}
     47{$R cevo.res}
    4848
    4949{$IFDEF DEBUG}
  • 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
  • trunk/Messg.pas

    r9 r17  
    9292  else
    9393  begin
    94     if integer(Msg.LParamHi) >= Top + TitleHeight then
     94    if integer((Msg.LParam shr 16) and $ffff) >= Top + TitleHeight then
    9595      Msg.result := HTCLIENT
    9696    else
     
    100100        begin
    101101          ControlBounds := Controls[i].BoundsRect;
    102           if (integer(Msg.LParamLo) >= Left + ControlBounds.Left) and
    103             (integer(Msg.LParamLo) < Left + ControlBounds.Right) and
    104             (integer(Msg.LParamHi) >= Top + ControlBounds.Top) and
    105             (integer(Msg.LParamHi) < Top + ControlBounds.Bottom) then
     102          if (integer(Msg.LParam and $ffff) >= Left + ControlBounds.Left) and
     103            (integer(Msg.LParam and $ffff) < Left + ControlBounds.Right) and
     104            (integer((Msg.LParam shr 16 ) and $ffff) >= Top + ControlBounds.Top) and
     105            (integer((Msg.LParam shr 16) and $ffff) < Top + ControlBounds.Bottom) then
    106106          begin
    107107            Msg.result := HTCLIENT;
  • trunk/NoTerm.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches.pas}
    22unit NoTerm;
    33
     
    55
    66uses
    7   ScreenTools, Protocol, Messg,
    8 
    9   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
     7  ScreenTools, Protocol, Messg, LCLIntf, LCLType, dateutils, Platform,
     8
     9  Messages, SysUtils, Classes, Graphics, Controls, Forms,
    1010  ButtonBase, ButtonB;
    1111
     
    2323  private
    2424    me, Active, ToldAlive, Round: integer;
    25     PerfFreq, LastShowYearTime, LastShowTurnChange, LastNewTurn: int64;
     25    LastShowYearTime, LastShowTurnChange, LastNewTurn: TDateTime;
    2626    TurnTime, TotalStatTime: extended;
    2727    G: TNewGameData;
     
    4747uses GameServer, log, Start;
    4848
    49 {$R *.DFM}
     49{$R *.dfm}
    5050
    5151const
     
    8181  TitleHeight := 36;
    8282  InitButtons();
    83   QueryPerformanceFrequency(PerfFreq);
    8483  LastShowYearTime := 0;
    8584end;
     
    139138  ShipComplete: boolean;
    140139  r: TRect;
    141   now: int64;
     140  nowt: TDateTime;
    142141begin
    143142  case Command of
     
    213212        end; // should not happen
    214213
    215         QueryPerformanceCounter(now);
    216         if {$IFDEF VER100}(now.LowPart - LastShowYearTime.LowPart){$ELSE}(now - LastShowYearTime){$ENDIF} / PerfFreq >= UpdateInterval then
     214        nowt := NowPrecise;
     215        if SecondOf(nowt - LastShowYearTime) >= UpdateInterval then
    217216        begin
    218217          ShowYear;
    219           LastShowYearTime := now;
     218          LastShowYearTime := nowt;
    220219        end;
    221         TurnTime :=
    222         {$IFDEF VER100}(now.LowPart - LastNewTurn.LowPart){$ELSE}(now - LastNewTurn){$ENDIF} / PerfFreq;
    223         LastNewTurn := now;
     220        TurnTime := SecondOf(nowt - LastNewTurn);
     221        LastNewTurn := nowt;
    224222        if (G.RO[me].Alive <> ToldAlive) then
    225223        begin
     
    267265    cShowTurnChange:
    268266      begin
    269         QueryPerformanceCounter(now);
     267        nowt := NowPrecise;
    270268        if Active >= 0 then
    271269        begin
    272           ActiveDuration :=
    273           {$IFDEF VER100}(now.LowPart - LastShowTurnChange.LowPart){$ELSE}(now - LastShowTurnChange){$ENDIF} / PerfFreq;
     270          ActiveDuration := SecondOf(nowt - LastShowTurnChange);
    274271          TimeStat[Active] := TimeStat[Active] + ActiveDuration;
    275272          TotalStatTime := TotalStatTime + ActiveDuration;
     
    279276            (ActiveDuration < ShowActiveThreshold);
    280277        end;
    281         LastShowTurnChange := now;
     278        LastShowTurnChange := nowt;
    282279
    283280        Active := integer(Data);
  • trunk/Protocol.pas

    r15 r17  
    1 {$INCLUDE switches.pas}
     1{$INCLUDE Switches.pas}
    22{$HINTS OFF}
    33unit Protocol;
  • trunk/ScreenTools.pas

    r15 r17  
    55
    66uses
    7   Windows, StringTables,
     7  StringTables,
    88  LCLIntf, LCLType, LMessages, Messages, SysUtils, Classes, Graphics, Controls,
    99  Forms, Menus;
     
    1616  end;
    1717
     18{$IFDEF WINDOWS}
    1819function ChangeResolution(x, y, bpp, freq: integer): boolean;
     20{$ENDIF}
    1921procedure RestoreResolution;
    2022function Play(Item: string; Index: integer = -1): boolean;
     
    192194
    193195var
     196  {$IFDEF WINDOWS}
    194197  StartResolution: TDeviceMode;
     198  {$ENDIF}
    195199  ResolutionChanged: boolean;
    196200
     
    198202  GammaLUT: array [0 .. 255] of Byte;
    199203
     204{$IFDEF WINDOWS}
    200205function ChangeResolution(x, y, bpp, freq: integer): boolean;
    201206var
     
    213218    ResolutionChanged := true;
    214219end;
     220{$ENDIF}
    215221
    216222procedure RestoreResolution;
    217223begin
     224  {$IFDEF WINDOWS}
    218225  if ResolutionChanged then
    219226    ChangeDisplaySettings(StartResolution, 0);
     227  {$ENDIF}
    220228  ResolutionChanged := false;
    221229end;
     
    14761484end;
    14771485
     1486{$IFDEF WINDOWS}
    14781487EnumDisplaySettings(nil, $FFFFFFFF, StartResolution);
     1488{$ENDIF}
    14791489ResolutionChanged := false;
    14801490
  • trunk/Sound.pas

    r6 r17  
    44
    55uses
    6   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, MMSystem;
     6  Messages, SysUtils, Classes, Graphics, Controls, Forms {$IFDEF WINDOWS}, MMSystem{$ENDIF};
    77
    88function PrepareSound(FileName: string): integer;
     
    1212  TSoundPlayer = class(TForm)
    1313  private
    14     procedure OnMCI(var m: TMessage); message MM_MCINOTIFY;
     14    {$IFDEF WINDOWS}
     15    procedure OnMCI(var m: TMessage); message MM_MCINOTIFY;}
     16    {$ENDIF}
    1517  end;
    1618
    1719implementation
    1820
    19 {$R *.DFM}
     21{$R *.dfm}
    2022
    2123type
     
    3234
    3335constructor TSound.Create(const FileName: string);
     36{$IFDEF WINDOWS}
    3437var
    3538  OpenParm: TMCI_Open_Parms;
     39{$ENDIF}
    3640begin
     41  {$IFDEF WINDOWS}
    3742  FDeviceID := 0;
    3843  FFileName := FileName;
     
    4651    FDeviceID := OpenParm.wDeviceID;
    4752  end
     53  {$ENDIF}
    4854end;
    4955
    5056destructor TSound.Destroy;
    5157begin
     58  {$IFDEF WINDOWS}
    5259  if FDeviceID <> 0 then
    53     mciSendCommand(FDeviceID, MCI_CLOSE, MCI_WAIT, 0);
     60    mciSendCommand(FDeviceID, MCI_CLOSE, MCI_WAIT, 0);}
     61  {$ENDIF}
    5462  inherited Destroy;
    5563end;
    5664
    5765procedure TSound.Play(HWND: DWORD);
     66{$IFDEF WINDOWS}
    5867var
    5968  PlayParm: TMCI_Play_Parms;
     69{$ENDIF}
    6070begin
     71  {$IFDEF WINDOWS}
    6172  if FDeviceID <> 0 then
    6273  begin
     
    6475    mciSendCommand(FDeviceID, MCI_PLAY, MCI_NOTIFY, integer(@PlayParm));
    6576  end
     77  {$ENDIF}
    6678end;
    6779
    6880procedure TSound.Stop;
    6981begin
     82  {$IFDEF WINDOWS}
    7083  mciSendCommand(FDeviceID, MCI_STOP, 0, 0);
     84  {$ENDIF}
    7185end;
    7286
    7387procedure TSound.Reset;
    7488begin
     89  {$IFDEF WINDOWS}
    7590  mciSendCommand(FDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
     91  {$ENDIF}
    7692end;
    7793
     
    85101  PlayingSound: TSound;
    86102
     103{$IFDEF WINDOWS}
    87104procedure TSoundPlayer.OnMCI(var m: TMessage);
    88105begin
     
    93110  end;
    94111end;
     112{$ENDIF}
    95113
    96114function PrepareSound(FileName: string): integer;
  • trunk/Start.pas

    r15 r17  
    249249    if Reg.ValueExists('ResolutionFreq') then
    250250      ResolutionFreq := Reg.ReadInteger('ResolutionFreq');
     251    {$IFDEF WINDOWS}
    251252    if ScreenMode = 2 then
    252253      ChangeResolution(ResolutionX, ResolutionY, ResolutionBPP,
    253254        ResolutionFreq);
     255    {$ENDIF}
    254256    Reg.closekey;
    255257  end;
  • trunk/StringTables.pas

    r6 r17  
    1 {$INCLUDE switches}
     1{$INCLUDE Switches}
    22unit StringTables;
    33
  • trunk/UnitProcessing.pas

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