hedgewars/ArgParsers.inc
author koda
Wed, 27 Oct 2010 14:02:20 +0200
branchexperimental3D
changeset 4004 b1c2c2f6fc5e
parent 3858 e40e5dfe9d5b
child 4976 088d40d8aba2
permissions -rw-r--r--
update branch with latest head, most likely breaking water color in stereo mode
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     1
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     2
procedure internalSetGameTypeLandPreviewFromParameters();
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     3
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     4
    val(ParamStr(2), ipcPort);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     5
    GameType:= gmtLandPreview;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     6
    if ParamStr(3) <> 'landpreview' then
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
     7
        GameType:= gmtSyntax
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     8
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
     9
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    10
procedure internalStartGameWithParameters();
4004
b1c2c2f6fc5e update branch with latest head, most likely breaking water color in stereo mode
koda
parents: 3858
diff changeset
    11
var tmp: LongInt;
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    12
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    13
    val(ParamStr(2), cScreenWidth);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    14
    val(ParamStr(3), cScreenHeight);
3709
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    15
    val(ParamStr(4), cBits);
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    16
    val(ParamStr(5), ipcPort);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    17
    cFullScreen:= ParamStr(6) = '1';
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    18
    isSoundEnabled:= ParamStr(7) = '1';
3709
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    19
    isMusicEnabled:= ParamStr(8) = '1';
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    20
    val(ParamStr(9), cInitVolume);
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    21
    val(ParamStr(10), cTimerInterval);
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    22
    PathPrefix:= ParamStr(11);
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    23
    cShowFPS:= ParamStr(12) = '1';
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    24
    cAltDamage:= ParamStr(13) = '1';
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    25
    UserNick:= DecodeBase64(ParamStr(14));
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    26
    val(ParamStr(15), cReducedQuality);
4004
b1c2c2f6fc5e update branch with latest head, most likely breaking water color in stereo mode
koda
parents: 3858
diff changeset
    27
    val(ParamStr(16), tmp);
b1c2c2f6fc5e update branch with latest head, most likely breaking water color in stereo mode
koda
parents: 3858
diff changeset
    28
    cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp)));
b1c2c2f6fc5e update branch with latest head, most likely breaking water color in stereo mode
koda
parents: 3858
diff changeset
    29
    cLocaleFName:= ParamStr(17);
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    30
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    31
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    32
procedure setVideo(screenWidth: LongInt; screenHeight: LongInt; bitsStr: LongInt);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    33
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    34
    cScreenWidth:= screenWidth;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    35
    cScreenHeight:= screenHeight;
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    36
    cBits:= bitsStr
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    37
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    38
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    39
procedure setVideoWithParameters(screenWidthParam: string; screenHeightParam: string; bitsParam: string);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    40
var screenWidthAsInt, screenHeightAsInt, bitsStrAsInt: LongInt;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    41
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    42
    val(screenWidthParam, screenWidthAsInt);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    43
    val(screenHeightParam, screenHeightAsInt);
3709
c7849b74748d clean and reorder arguments passed to engine
koda
parents: 3708
diff changeset
    44
    val(bitsParam, bitsStrAsInt);
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    45
    setVideo(screenWidthAsInt,screenHeightAsInt,bitsStrAsInt)
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    46
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    47
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    48
procedure setOtherOptions(languageFile: string; fullScreen: boolean);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    49
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    50
    cLocaleFName:= languageFile;
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    51
    cFullScreen:= fullScreen
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    52
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    53
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    54
procedure setShowFPS(showFPS: boolean);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    55
begin
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    56
    cShowFPS:= showFPS
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    57
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    58
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    59
procedure setOtherOptionsWithParameters(languageFileParam: string; fullScreenParam: string; showFPSParam: string);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    60
var fullScreen, showFPS: boolean;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    61
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    62
    fullScreen:= fullScreenParam = '1';
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    63
    showFPS:= showFPSParam = '1';
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    64
    setOtherOptions(languageFileParam,fullScreen);
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    65
    setShowFPS(showFPS)
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    66
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    67
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    68
procedure setAudio(initialVolume: LongInt; musicEnabled: boolean; soundEnabled: boolean);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    69
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    70
    cInitVolume:= initialVolume;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    71
    isMusicEnabled:= musicEnabled;
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    72
    isSoundEnabled:= soundEnabled
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    73
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    74
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    75
procedure setAudioWithParameters(initialVolumeParam: string; musicEnabledParam: string; soundEnabledParam: string);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    76
var initialVolumeAsInt: LongInt;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    77
    musicEnabled, soundEnabled: boolean;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    78
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    79
    val(initialVolumeParam, initialVolumeAsInt);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    80
    musicEnabled:= musicEnabledParam = '1';
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    81
    soundEnabled:= soundEnabledParam = '1';
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    82
    setAudio(initialVolumeAsInt,musicEnabled, soundEnabled)
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    83
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    84
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    85
procedure setMultimediaOptionsWithParameters(screenWidthParam, screenHeightParam, bitsParam: string;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    86
                                             initialVolumeParam, musicEnabledParam, soundEnabledParam: string;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    87
                                             languageFileParam, fullScreenParam: string);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    88
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    89
    setVideoWithParameters(screenWidthParam,screenHeightParam, bitsParam);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    90
    setAudioWithParameters(initialVolumeParam,musicEnabledParam,soundEnabledParam);
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
    91
    setOtherOptions(languageFileParam,fullScreenParam = '1')
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    92
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    93
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    94
procedure setAltDamageTimerValueAndQuality(altDamage: boolean; timeIterval: LongInt; reducedQuality: boolean);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    95
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    96
    cAltDamage:= altDamage;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    97
    cTimerInterval:= timeIterval;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    98
    if (reducedQuality) then        //HACK
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
    99
        cReducedQuality:= $FFFFFFFF xor rqLowRes
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   100
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   101
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   102
procedure setAllOptionsWithParameters(screenWidthParam:string; screenHeightParam:string; bitsParam:string;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   103
                                      initialVolumeParam:string; musicEnabledParam:string; soundEnabledParam:string;
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   104
                                      languageFileParam:string; fullScreenParam:string; showFPSParam:string;
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   105
                                      altDamageParam:string; timeItervalParam:string; reducedQualityParam: string);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   106
var showFPS, altDamage, reducedQuality: boolean;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   107
    timeIterval: LongInt;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   108
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   109
    setMultimediaOptionsWithParameters(screenWidthParam,screenHeightParam, bitsParam,
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   110
                                       initialVolumeParam,musicEnabledParam,soundEnabledParam,
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   111
                                       languageFileParam,fullScreenParam);
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   112
    showFPS := showFPSParam = '1';
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   113
    setShowFPS(showFPS);
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   114
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   115
    altDamage:= altDamageParam = '1';
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   116
    val(timeItervalParam, timeIterval);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   117
    reducedQuality:= reducedQualityParam = '1';
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   118
    setAltDamageTimerValueAndQuality(altDamage,timeIterval,reducedQuality);
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   119
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   120
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   121
procedure playReplayFileWithParameters();
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   122
var paramIndex: LongInt;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   123
    wrongParameter: boolean;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   124
begin
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   125
    PathPrefix:= ParamStr(1);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   126
    recordFileName:= ParamStr(2);
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   127
    paramIndex:= 3;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   128
    wrongParameter:= false;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   129
    while (paramIndex <= ParamCount) and not wrongParameter do
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   130
        begin
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   131
        if ParamStr(paramIndex) = '--set-video'  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   132
//--set-video [screen width] [screen height] [color dept]
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   133
            begin
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   134
            if(ParamCount-paramIndex < 3) then
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   135
                begin
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   136
                wrongParameter:= true;
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   137
                GameType:= gmtSyntax
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   138
                end;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   139
            setVideoWithParameters(ParamStr(paramIndex+1), ParamStr(paramIndex+2), ParamStr(paramIndex+3));
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   140
            paramIndex:= paramIndex + 4
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   141
            end
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   142
        else
3858
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   143
//--set-audio [volume] [enable music] [enable sounds]
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   144
            if ParamStr(paramIndex) = '--set-audio'  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   145
                begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   146
                if(ParamCount-paramIndex < 3) then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   147
                    begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   148
                    wrongParameter := true;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   149
                    GameType:= gmtSyntax
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   150
                    end;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   151
                setAudioWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3));
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   152
                paramIndex:= paramIndex + 4
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   153
                end
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   154
            else
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   155
// --set-other [language file] [full screen] [show FPS]
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   156
                if ParamStr(paramIndex) = '--set-other'  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   157
                    begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   158
                    if(ParamCount-paramIndex < 3) then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   159
                        begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   160
                        wrongParameter:= true;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   161
                        GameType:= gmtSyntax
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   162
                        end;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   163
                    setOtherOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3));
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   164
                    paramIndex:= paramIndex + 4
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   165
                    end
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   166
                else
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   167
//--set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen]
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   168
                    if ParamStr(paramIndex) = '--set-multimedia'  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   169
                        begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   170
                        if ParamCount-paramIndex < 8  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   171
                            begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   172
                            wrongParameter:= true;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   173
                            GameType:= gmtSyntax
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   174
                            end;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   175
                        setMultimediaOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3),
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   176
                                                           ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6),
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   177
                                                           ParamStr(paramIndex+7),ParamStr(paramIndex+8));
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   178
                        paramIndex:= paramIndex + 9
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   179
                        end
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   180
                    else
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   181
//--set-everything [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] [show FPS] [alternate damage] [timer value] [reduced quality]
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   182
                        if ParamStr(paramIndex) = '--set-everything'  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   183
                            begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   184
                            if ParamCount-paramIndex < 12  then
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   185
                                begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   186
                                wrongParameter:= true;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   187
                                GameType:= gmtSyntax
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   188
                                end;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   189
                            setAllOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3),
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   190
                                                        ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6),
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   191
                                                        ParamStr(paramIndex+7),ParamStr(paramIndex+8),ParamStr(paramIndex+9),
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   192
                                                        ParamStr(paramIndex+10),ParamStr(paramIndex+11),ParamStr(paramIndex+12));
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   193
                            paramIndex:= paramIndex + 13
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   194
                            end
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   195
                        else
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   196
                            begin
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   197
                            wrongParameter:= true;
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   198
                            GameType:= gmtSyntax
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   199
                            end
e40e5dfe9d5b clean up koda's indenting :-p
nemo
parents: 3709
diff changeset
   200
    end
3678
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   201
end;
00428183300f patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff changeset
   202