hedgewars/ArgParsers.inc
changeset 7021 0c75512a8920
parent 6982 8d41d22a291d
child 7151 ec15d9e1a7e3
equal deleted inserted replaced
7019:333afe233886 7021:0c75512a8920
    38     val(ParamStr(2), cScreenWidth);
    38     val(ParamStr(2), cScreenWidth);
    39     val(ParamStr(3), cScreenHeight);
    39     val(ParamStr(3), cScreenHeight);
    40     val(ParamStr(4), cBits);
    40     val(ParamStr(4), cBits);
    41     val(ParamStr(5), ipcPort);
    41     val(ParamStr(5), ipcPort);
    42     cFullScreen:= ParamStr(6) = '1';
    42     cFullScreen:= ParamStr(6) = '1';
    43     isSoundEnabled:= ParamStr(7) = '1';
    43     SetSound(ParamStr(7) = '1');
    44     isMusicEnabled:= ParamStr(8) = '1';
    44     SetMusic(ParamStr(8) = '1');
    45     val(ParamStr(9), cInitVolume);
    45     val(ParamStr(9), tmp);
       
    46     SetVolume(tmp);
    46     val(ParamStr(10), cTimerInterval);
    47     val(ParamStr(10), cTimerInterval);
    47     PathPrefix:= ParamStr(11);
    48     PathPrefix:= ParamStr(11);
    48     cShowFPS:= ParamStr(12) = '1';
    49     cShowFPS:= ParamStr(12) = '1';
    49     cAltDamage:= ParamStr(13) = '1';
    50     cAltDamage:= ParamStr(13) = '1';
    50     UserNick:= DecodeBase64(ParamStr(14));
    51     UserNick:= DecodeBase64(ParamStr(14));
    99     setShowFPS(showFPS)
   100     setShowFPS(showFPS)
   100 end;
   101 end;
   101 
   102 
   102 procedure setAudio(initialVolume: LongInt; musicEnabled: boolean; soundEnabled: boolean);
   103 procedure setAudio(initialVolume: LongInt; musicEnabled: boolean; soundEnabled: boolean);
   103 begin
   104 begin
   104     cInitVolume:= initialVolume;
   105     SetVolume(initialVolume);
   105     isMusicEnabled:= musicEnabled;
   106     SetMusic(musicEnabled);
   106     isSoundEnabled:= soundEnabled
   107     SetSound(soundEnabled);
   107 end;
   108 end;
   108 
   109 
   109 procedure setAudioWithParameters(initialVolumeParam: string; musicEnabledParam: string; soundEnabledParam: string);
   110 procedure setAudioWithParameters(initialVolumeParam: string; musicEnabledParam: string; soundEnabledParam: string);
   110 var initialVolumeAsInt: LongInt;
   111 var initialVolumeAsInt: LongInt;
   111     musicEnabled, soundEnabled: boolean;
   112     musicEnabled, soundEnabled: boolean;
   229                             end
   230                             end
   230                         else
   231                         else
   231                             if ParamStr(paramIndex) = '--stats-only'  then
   232                             if ParamStr(paramIndex) = '--stats-only'  then
   232                                 begin
   233                                 begin
   233                                 cOnlyStats:= true;
   234                                 cOnlyStats:= true;
   234                                 isSoundEnabled:= false;
   235                                 SetSound(false);
   235                                 isMusicEnabled:= false;
   236                                 SetMusic(false);
   236                                 cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK
   237                                 cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK
   237                                 paramIndex:= paramIndex + 1
   238                                 paramIndex:= paramIndex + 1
   238                                 end
   239                                 end
   239                             else
   240                             else
   240                                 begin
   241                                 begin