hedgewars/hwengine.dpr
changeset 498 9c8b385dc9a1
parent 497 adf1aee202c6
child 510 4e994e1b7abb
equal deleted inserted replaced
497:adf1aee202c6 498:9c8b385dc9a1
     1 (*
     1  (*
     2  * Hedgewars, a worms-like game
     2  * Hedgewars, a worms-like game
     3  * Copyright (c) 2004-2007 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2004-2007 Andrey Korotaev <unC0Rr@gmail.com>
     4  *
     4  *
     5  * This program is free software; you can redistribute it and/or modify
     5  * This program is free software; you can redistribute it and/or modify
     6  * it under the terms of the GNU General Public License as published by
     6  * it under the terms of the GNU General Public License as published by
   161 until isTerminated
   161 until isTerminated
   162 end;
   162 end;
   163 
   163 
   164 ////////////////////
   164 ////////////////////
   165 procedure GetParams;
   165 procedure GetParams;
   166 var c: LongInt;
   166 var 
   167 {$IFDEF DEBUGFILE}
   167 {$IFDEF DEBUGFILE}
   168     i: LongInt;
   168     i: LongInt;
   169 {$ENDIF}
   169 {$ENDIF}
   170     p: TPathType;
   170     p: TPathType;
   171 begin
   171 begin
   175     AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   175     AddFileLog(inttostr(i) + ': ' + ParamStr(i));
   176 {$ENDIF}
   176 {$ENDIF}
   177 
   177 
   178 case ParamCount of
   178 case ParamCount of
   179 12: begin
   179 12: begin
   180      val(ParamStr(2), cScreenWidth, c);
   180      val(ParamStr(2), cScreenWidth);
   181      val(ParamStr(3), cScreenHeight, c);
   181      val(ParamStr(3), cScreenHeight);
   182      cBitsStr:= ParamStr(4);
   182      cBitsStr:= ParamStr(4);
   183      val(cBitsStr, cBits, c);
   183      val(cBitsStr, cBits);
   184      val(ParamStr(5), ipcPort, c);
   184      val(ParamStr(5), ipcPort);
   185      cFullScreen:= ParamStr(6) = '1';
   185      cFullScreen:= ParamStr(6) = '1';
   186      isSoundEnabled:= ParamStr(7) = '1';
   186      isSoundEnabled:= ParamStr(7) = '1';
   187      cLocaleFName:= ParamStr(8);
   187      cLocaleFName:= ParamStr(8);
   188      val(ParamStr(9), cInitVolume, c);
   188      val(ParamStr(9), cInitVolume);
   189      val(ParamStr(10), cTimerInterval, c);
   189      val(ParamStr(10), cTimerInterval);
   190      PathPrefix:= ParamStr(11);
   190      PathPrefix:= ParamStr(11);
   191      cShowFPS:= ParamStr(12) = '1';
   191      cShowFPS:= ParamStr(12) = '1';
   192      for p:= Succ(Low(TPathType)) to High(TPathType) do
   192      for p:= Succ(Low(TPathType)) to High(TPathType) do
   193          if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p];
   193          if p <> ptMapCurrent then Pathz[p]:= PathPrefix + '/' + Pathz[p];
   194      AddClouds
   194      AddClouds
   195      end;
   195      end;
   196   3: begin
   196   3: begin
   197      val(ParamStr(2), ipcPort, c);
   197      val(ParamStr(2), ipcPort);
   198      GameType:= gmtLandPreview;
   198      GameType:= gmtLandPreview;
   199      if ParamStr(3) <> 'landpreview' then OutError(errmsgShouldntRun, true);
   199      if ParamStr(3) <> 'landpreview' then OutError(errmsgShouldntRun, true);
   200      end
   200      end
   201    else
   201    else
   202    OutError(errmsgShouldntRun, true)
   202    OutError(errmsgShouldntRun, true)