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