hedgewars/ArgParsers.inc
changeset 8207 5f08609613fe
parent 8204 9a6030d96273
child 8209 780e156f19ea
child 8220 67105120662c
equal deleted inserted replaced
8206:1633a6510834 8207:5f08609613fe
    66 
    66 
    67 procedure DisplayUsage;
    67 procedure DisplayUsage;
    68 begin
    68 begin
    69     WriteLn(stdout, 'Usage:');
    69     WriteLn(stdout, 'Usage:');
    70     WriteLn(stdout, '');
    70     WriteLn(stdout, '');
    71     WriteLn(stdout, '  hwengine <path to user hedgewars folder> <path to global data folder> <path to replay file> [options]');
    71     WriteLn(stdout, '  hwengine [path to user hedgewars folder] <path to global data folder> <path to replay file> [options]');
    72     WriteLn(stdout, '');
    72     WriteLn(stdout, '');
    73     WriteLn(stdout, 'where [options] are any of the following:');
    73     WriteLn(stdout, 'where [options] are any of the following:');
    74     WriteLn(stdout, ' --locale [path to language file]');
    74     WriteLn(stdout, ' --locale [path to language file]');
    75     WriteLn(stdout, ' --width  [screen width in pixels]');
    75     WriteLn(stdout, ' --width  [screen width in pixels]');
    76     WriteLn(stdout, ' --height [screen height in pixels]');
    76     WriteLn(stdout, ' --height [screen height in pixels]');
   204             parseParameter(cmdArray[index], ParamStr(paramIndex), tmpInt);
   204             parseParameter(cmdArray[index], ParamStr(paramIndex), tmpInt);
   205         index:= index+1;
   205         index:= index+1;
   206         end;
   206         end;
   207 end;
   207 end;
   208 
   208 
   209 procedure playReplayFileWithParameters();
   209 procedure playReplayFileWithParameters(paramIndex: LongInt);
   210 var paramIndex, tmpInt: LongInt;
   210 var tmpInt: LongInt;
   211     wrongParameter: boolean;
   211     wrongParameter: boolean;
   212 begin
   212 begin
   213     UserPathPrefix:= ParamStr(1);
       
   214     PathPrefix:= ParamStr(2);
       
   215     recordFileName:= ParamStr(3);
       
   216     paramIndex:= 4;
       
   217     wrongParameter:= false;
   213     wrongParameter:= false;
   218     while (paramIndex <= ParamCount) do
   214     while (paramIndex <= ParamCount) do
   219         begin
   215         begin
   220         if parseParameter( ParamStr(paramIndex), ParamStr(paramIndex+1), paramIndex) then
   216         if parseParameter( ParamStr(paramIndex), ParamStr(paramIndex+1), paramIndex) then
   221             wrongParameter:= true;
   217             wrongParameter:= true;