hedgewars/ArgParsers.inc
branchwebgl
changeset 9127 e350500c4edb
parent 8850 ae8a957c69fd
parent 9080 9b42757d7e71
equal deleted inserted replaced
8860:bde641cf53c8 9127:e350500c4edb
     1 (*
     1 (*
     2  * Hedgewars, a free turn based strategy game
     2  * Hedgewars, a free turn based strategy game
     3  * Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com>
     3  * Copyright (c) 2004-2013 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
     7  * the Free Software Foundation; version 2 of the License
     7  * the Free Software Foundation; version 2 of the License
     8  *
     8  *
   171       audioarray: array [0..2] of shortstring = ('--volume','--nomusic','--nosound');
   171       audioarray: array [0..2] of shortstring = ('--volume','--nomusic','--nosound');
   172       otherarray: array [0..2] of shortstring = ('--locale','--fullscreen','--showfps');
   172       otherarray: array [0..2] of shortstring = ('--locale','--fullscreen','--showfps');
   173       mediaarray: array [0..9] of shortstring = ('--fullscreen-width', '--fullscreen-height', '--width', '--height', '--depth', '--volume','--nomusic','--nosound','--locale','--fullscreen');
   173       mediaarray: array [0..9] of shortstring = ('--fullscreen-width', '--fullscreen-height', '--width', '--height', '--depth', '--volume','--nomusic','--nosound','--locale','--fullscreen');
   174       allarray: array [0..13] of shortstring = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth','--volume','--nomusic','--nosound','--locale','--fullscreen','--showfps','--altdmg','--frame-interval','--low-quality');
   174       allarray: array [0..13] of shortstring = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth','--volume','--nomusic','--nosound','--locale','--fullscreen','--showfps','--altdmg','--frame-interval','--low-quality');
   175       reallyAll: array[0..30] of shortstring = (
   175       reallyAll: array[0..30] of shortstring = (
   176                 '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width', 
   176                 '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width',
   177                 '--height', '--frame-interval', '--volume','--nomusic', '--nosound',
   177                 '--height', '--frame-interval', '--volume','--nomusic', '--nosound',
   178                 '--fullscreen', '--showfps', '--altdmg', '--low-quality', '--raw-quality', '--stereo', '--nick', 
   178                 '--fullscreen', '--showfps', '--altdmg', '--low-quality', '--raw-quality', '--stereo', '--nick',
   179   {deprecated}  '--depth', '--set-video', '--set-audio', '--set-other', '--set-multimedia', '--set-everything',
   179   {deprecated}  '--depth', '--set-video', '--set-audio', '--set-other', '--set-multimedia', '--set-everything',
   180   {internal}    '--internal', '--port', '--recorder', '--landpreview',
   180   {internal}    '--internal', '--port', '--recorder', '--landpreview',
   181   {misc}        '--stats-only', '--gci', '--help');
   181   {misc}        '--stats-only', '--gci', '--help');
   182 var cmdIndex: byte;
   182 var cmdIndex: byte;
   183 begin
   183 begin
   190     while (cmdIndex <= High(reallyAll)) and (cmd <> reallyAll[cmdIndex]) do inc(cmdIndex);
   190     while (cmdIndex <= High(reallyAll)) and (cmd <> reallyAll[cmdIndex]) do inc(cmdIndex);
   191     case cmdIndex of
   191     case cmdIndex of
   192         {--prefix}               0 : PathPrefix        := getStringParameter (arg, paramIndex, parseParameter);
   192         {--prefix}               0 : PathPrefix        := getStringParameter (arg, paramIndex, parseParameter);
   193         {--user-prefix}          1 : UserPathPrefix    := getStringParameter (arg, paramIndex, parseParameter);
   193         {--user-prefix}          1 : UserPathPrefix    := getStringParameter (arg, paramIndex, parseParameter);
   194         {--locale}               2 : cLocaleFName      := getStringParameter (arg, paramIndex, parseParameter);
   194         {--locale}               2 : cLocaleFName      := getStringParameter (arg, paramIndex, parseParameter);
   195         {--fullscreen-width}     3 : cFullscreenWidth  := getLongIntParameter(arg, paramIndex, parseParameter);
   195         {--fullscreen-width}     3 : cFullscreenWidth  := max(getLongIntParameter(arg, paramIndex, parseParameter), cMinScreenWidth);
   196         {--fullscreen-height}    4 : cFullscreenHeight := getLongIntParameter(arg, paramIndex, parseParameter);
   196         {--fullscreen-height}    4 : cFullscreenHeight := max(getLongIntParameter(arg, paramIndex, parseParameter), cMinScreenHeight);
   197         {--width}                5 : cWindowedWidth    := getLongIntParameter(arg, paramIndex, parseParameter);
   197         {--width}                5 : cWindowedWidth    := max(2 * (getLongIntParameter(arg, paramIndex, parseParameter) div 2), cMinScreenWidth);
   198         {--height}               6 : cWindowedHeight   := getLongIntParameter(arg, paramIndex, parseParameter);
   198         {--height}               6 : cWindowedHeight   := max(2 * (getLongIntParameter(arg, paramIndex, parseParameter) div 2), cMinScreenHeight);
   199         {--frame-interval}       7 : cTimerInterval    := getLongIntParameter(arg, paramIndex, parseParameter);
   199         {--frame-interval}       7 : cTimerInterval    := getLongIntParameter(arg, paramIndex, parseParameter);
   200         {--volume}               8 : SetVolume          ( getLongIntParameter(arg, paramIndex, parseParameter) );
   200         {--volume}               8 : SetVolume          ( max(getLongIntParameter(arg, paramIndex, parseParameter), 0) );
   201         {--nomusic}              9 : SetMusic           ( false );
   201         {--nomusic}              9 : SetMusic           ( false );
   202         {--nosound}             10 : SetSound           ( false );
   202         {--nosound}             10 : SetSound           ( false );
   203         {--fullscreen}          11 : cFullScreen       := true;
   203         {--fullscreen}          11 : cFullScreen       := true;
   204         {--showfps}             12 : cShowFPS          := true;
   204         {--showfps}             12 : cShowFPS          := true;
   205         {--altdmg}              13 : cAltDamage        := true;
   205         {--altdmg}              13 : cAltDamage        := true;