diff -r ca67740f19b2 -r 8572d1f8b2f0 hedgewars/ArgParsers.pas --- a/hedgewars/ArgParsers.pas Sun Jan 26 10:20:42 2014 +0400 +++ b/hedgewars/ArgParsers.pas Mon Jan 27 00:33:42 2014 +0400 @@ -182,14 +182,14 @@ getstringParameter:= str; end; -procedure parseClassicParameter(cmdArray: array of string; size:LongInt; var paramIndex:LongInt); forward; +procedure parseClassicParameter(cmdarray: array of string; size:LongInt; var paramIndex:LongInt); forward; function parseParameter(cmd:string; arg:string; var paramIndex:LongInt): Boolean; -const videoArray: Array [1..5] of string = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth'); - audioArray: Array [1..3] of string = ('--volume','--nomusic','--nosound'); - otherArray: Array [1..3] of string = ('--locale','--fullscreen','--showfps'); - mediaArray: Array [1..10] of string = ('--fullscreen-width', '--fullscreen-height', '--width', '--height', '--depth', '--volume','--nomusic','--nosound','--locale','--fullscreen'); - allArray: Array [1..18] of string = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth','--volume','--nomusic','--nosound','--locale','--fullscreen','--showfps','--altdmg','--frame-interval','--low-quality','--no-teamtag','--no-hogtag','--no-healthtag','--translucent-tags'); +const videoarray: array [0..4] of string = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth'); + audioarray: array [0..2] of string = ('--volume','--nomusic','--nosound'); + otherarray: array [0..2] of string = ('--locale','--fullscreen','--showfps'); + mediaarray: array [0..9] of string = ('--fullscreen-width', '--fullscreen-height', '--width', '--height', '--depth', '--volume','--nomusic','--nosound','--locale','--fullscreen'); + allarray: array [0..17] of string = ('--fullscreen-width','--fullscreen-height', '--width', '--height', '--depth','--volume','--nomusic','--nosound','--locale','--fullscreen','--showfps','--altdmg','--frame-interval','--low-quality','--no-teamtag','--no-hogtag','--no-healthtag','--translucent-tags'); reallyAll: array[0..35] of shortstring = ( '--prefix', '--user-prefix', '--locale', '--fullscreen-width', '--fullscreen-height', '--width', '--height', '--frame-interval', '--volume','--nomusic', '--nosound', @@ -227,11 +227,11 @@ {--nick} 17 : UserNick := parseNick( getstringParameter(arg, paramIndex, parseParameter) ); {deprecated options} {--depth} 18 : setDepth(paramIndex); - {--set-video} 19 : parseClassicParameter(videoArray,5,paramIndex); - {--set-audio} 20 : parseClassicParameter(audioArray,3,paramIndex); - {--set-other} 21 : parseClassicParameter(otherArray,3,paramIndex); - {--set-multimedia} 22 : parseClassicParameter(mediaArray,10,paramIndex); - {--set-everything} 23 : parseClassicParameter(allArray,14,paramIndex); + {--set-video} 19 : parseClassicParameter(videoarray,5,paramIndex); + {--set-audio} 20 : parseClassicParameter(audioarray,3,paramIndex); + {--set-other} 21 : parseClassicParameter(otherarray,3,paramIndex); + {--set-multimedia} 22 : parseClassicParameter(mediaarray,10,paramIndex); + {--set-everything} 23 : parseClassicParameter(allarray,14,paramIndex); {"internal" options} {--internal} 24 : {$IFDEF HWLIBRARY}isInternal:= true{$ENDIF}; {--port} 25 : setIpcPort( getLongIntParameter(arg, paramIndex, parseParameter), parseParameter ); @@ -241,9 +241,9 @@ {--stats-only} 28 : statsOnlyGame(); {--gci} 29 : GciEasterEgg(); {--help} 30 : DisplayUsage(); - {--no-teamtag} 31 : cTagsMask := cTagsMask and not htTeamName; - {--no-hogtag} 32 : cTagsMask := cTagsMask and not htName; - {--no-healthtag} 33 : cTagsMask := cTagsMask and not htHealth; + {--no-teamtag} 31 : cTagsMask := cTagsMask and (not htTeamName); + {--no-hogtag} 32 : cTagsMask := cTagsMask and (not htName); + {--no-healthtag} 33 : cTagsMask := cTagsMask and (not htHealth); {--translucent-tags} 34 : cTagsMask := cTagsMask or htTransparent; {--lua-test} 35 : begin cTestLua := true; cScriptName := getstringParameter(arg, paramIndex, parseParameter); WriteLn(stdout, 'Lua test file specified: ' + cScriptName);end; else @@ -260,7 +260,7 @@ end; end; -procedure parseClassicParameter(cmdArray: array of string; size:LongInt; var paramIndex:LongInt); +procedure parseClassicParameter(cmdarray: array of string; size:LongInt; var paramIndex:LongInt); var index, tmpInt: LongInt; isBool, isValid: Boolean; cmd, arg, newSyntax: string; @@ -276,7 +276,7 @@ begin newSyntax:= ''; inc(paramIndex); - cmd:= cmdArray[index]; + cmd:= cmdarray[index]; arg:= ParamStr(paramIndex); isValid:= (cmd<>'--depth');