hedgewars/ArgParsers.inc
changeset 5130 3602ede67ec5
parent 4976 088d40d8aba2
child 5238 46ddaf14509d
equal deleted inserted replaced
5128:3c65326bb713 5130:3602ede67ec5
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
    18 
    18 
       
    19 procedure playReplayFileWithParameters(); forward;
       
    20 
    19 procedure internalSetGameTypeLandPreviewFromParameters();
    21 procedure internalSetGameTypeLandPreviewFromParameters();
    20 begin
    22 begin
    21     val(ParamStr(2), ipcPort);
    23     if ParamStr(3) = '--stats-only' then
    22     GameType:= gmtLandPreview;
    24         playReplayFileWithParameters()
    23     if ParamStr(3) <> 'landpreview' then
    25     else
    24         GameType:= gmtSyntax
    26         begin
       
    27         val(ParamStr(2), ipcPort);
       
    28         GameType:= gmtLandPreview;
       
    29         if ParamStr(3) <> 'landpreview' then
       
    30             GameType:= gmtSyntax
       
    31         end
    25 end;
    32 end;
    26 
    33 
    27 procedure internalStartGameWithParameters();
    34 procedure internalStartGameWithParameters();
    28 var tmp: LongInt;
    35 var tmp: LongInt;
    29 begin
    36 begin
   208                                                         ParamStr(paramIndex+7),ParamStr(paramIndex+8),ParamStr(paramIndex+9),
   215                                                         ParamStr(paramIndex+7),ParamStr(paramIndex+8),ParamStr(paramIndex+9),
   209                                                         ParamStr(paramIndex+10),ParamStr(paramIndex+11),ParamStr(paramIndex+12));
   216                                                         ParamStr(paramIndex+10),ParamStr(paramIndex+11),ParamStr(paramIndex+12));
   210                             paramIndex:= paramIndex + 13
   217                             paramIndex:= paramIndex + 13
   211                             end
   218                             end
   212                         else
   219                         else
   213                             begin
   220                             if ParamStr(paramIndex) = '--stats-only'  then
   214                             wrongParameter:= true;
   221                                 begin
   215                             GameType:= gmtSyntax
   222                                 cOnlyStats:= true;
   216                             end
   223                                 isSoundEnabled:= false;
       
   224                                 isMusicEnabled:= false;
       
   225                                 cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK
       
   226                                 paramIndex:= paramIndex + 1
       
   227                                 end
       
   228                             else
       
   229                                 begin
       
   230                                 wrongParameter:= true;
       
   231                                 GameType:= gmtSyntax
       
   232                                 end
   217     end
   233     end
   218 end;
   234 end;
   219 
   235