author | Medo <smaxein@googlemail.com> |
Wed, 22 Aug 2012 01:30:56 +0200 | |
changeset 7586 | 33924ff4af50 |
parent 7151 | ec15d9e1a7e3 |
child 7180 | 53ffc8853008 |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
6700 | 3 |
* Copyright (c) 2004-2012 Andrey Korotaev <unC0Rr@gmail.com> |
4976 | 4 |
* |
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 |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*) |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
18 |
|
5130
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
19 |
procedure playReplayFileWithParameters(); forward; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
20 |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
21 |
procedure internalSetGameTypeLandPreviewFromParameters(); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
22 |
begin |
5130
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
23 |
if ParamStr(3) = '--stats-only' then |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
24 |
playReplayFileWithParameters() |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
25 |
else |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
26 |
begin |
7151 | 27 |
ipcPort:= StrToInt(ParamStr(2)); |
5130
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
28 |
GameType:= gmtLandPreview; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
29 |
if ParamStr(3) <> 'landpreview' then |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
30 |
GameType:= gmtSyntax |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
31 |
end |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
32 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
33 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
34 |
procedure internalStartGameWithParameters(); |
4004
b1c2c2f6fc5e
update branch with latest head, most likely breaking water color in stereo mode
koda
parents:
3858
diff
changeset
|
35 |
var tmp: LongInt; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
36 |
begin |
5239 | 37 |
UserPathPrefix:= ParamStr(1); |
7151 | 38 |
cScreenWidth:= StrToInt(ParamStr(2)); |
39 |
cScreenHeight:= StrToInt(ParamStr(3)); |
|
40 |
cBits:= StrToInt(ParamStr(4)); |
|
41 |
ipcPort:= StrToInt(ParamStr(5)); |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
42 |
cFullScreen:= ParamStr(6) = '1'; |
7021
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
43 |
SetSound(ParamStr(7) = '1'); |
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
44 |
SetMusic(ParamStr(8) = '1'); |
7151 | 45 |
SetVolume(StrToInt(ParamStr(9))); |
46 |
cTimerInterval:= StrToInt(ParamStr(10)); |
|
3709 | 47 |
PathPrefix:= ParamStr(11); |
48 |
cShowFPS:= ParamStr(12) = '1'; |
|
49 |
cAltDamage:= ParamStr(13) = '1'; |
|
50 |
UserNick:= DecodeBase64(ParamStr(14)); |
|
7151 | 51 |
cReducedQuality:= StrToInt(ParamStr(15)); |
52 |
tmp:= StrToInt(ParamStr(16)); |
|
6982 | 53 |
GrayScale:= false; |
5441
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
54 |
if (tmp > 9) and (tmp < 16) then |
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
55 |
begin |
6982 | 56 |
GrayScale:= true; |
5441
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
57 |
cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp-9))) |
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
58 |
end |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6426
diff
changeset
|
59 |
else if tmp <= 9 then |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6426
diff
changeset
|
60 |
cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp))) |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6426
diff
changeset
|
61 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6426
diff
changeset
|
62 |
cStereoMode:= TStereoMode(max(0, min(ord(high(TStereoMode)), tmp-6))); |
4004
b1c2c2f6fc5e
update branch with latest head, most likely breaking water color in stereo mode
koda
parents:
3858
diff
changeset
|
63 |
cLocaleFName:= ParamStr(17); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
64 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
65 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
66 |
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
|
67 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
68 |
cScreenWidth:= screenWidth; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
69 |
cScreenHeight:= screenHeight; |
3858 | 70 |
cBits:= bitsStr |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
71 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
72 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
73 |
procedure setVideoWithParameters(screenWidthParam: string; screenHeightParam: string; bitsParam: string); |
7151 | 74 |
var screenWidthAsInt, screenHeightAsInt, bitsStrAsInt, c: LongInt; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
75 |
begin |
7151 | 76 |
val(screenWidthParam, screenWidthAsInt, c); |
77 |
val(screenHeightParam, screenHeightAsInt, c); |
|
78 |
val(bitsParam, bitsStrAsInt, c); |
|
3858 | 79 |
setVideo(screenWidthAsInt,screenHeightAsInt,bitsStrAsInt) |
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 setOtherOptions(languageFile: string; fullScreen: boolean); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
83 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
84 |
cLocaleFName:= languageFile; |
3858 | 85 |
cFullScreen:= fullScreen |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
86 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
87 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
88 |
procedure setShowFPS(showFPS: boolean); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
89 |
begin |
3858 | 90 |
cShowFPS:= showFPS |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
91 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
92 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
93 |
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
|
94 |
var fullScreen, showFPS: 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 |
fullScreen:= fullScreenParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
97 |
showFPS:= showFPSParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
98 |
setOtherOptions(languageFileParam,fullScreen); |
3858 | 99 |
setShowFPS(showFPS) |
3678
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 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
|
103 |
begin |
7021
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
104 |
SetVolume(initialVolume); |
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
105 |
SetMusic(musicEnabled); |
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
106 |
SetSound(soundEnabled); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
107 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
108 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
109 |
procedure setAudioWithParameters(initialVolumeParam: string; musicEnabledParam: string; soundEnabledParam: string); |
7151 | 110 |
var initialVolumeAsInt, c: LongInt; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
111 |
musicEnabled, soundEnabled: boolean; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
112 |
begin |
7151 | 113 |
val(initialVolumeParam, initialVolumeAsInt, c); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
114 |
musicEnabled:= musicEnabledParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
115 |
soundEnabled:= soundEnabledParam = '1'; |
3858 | 116 |
setAudio(initialVolumeAsInt,musicEnabled, soundEnabled) |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
117 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
118 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
119 |
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
|
120 |
initialVolumeParam, musicEnabledParam, soundEnabledParam: string; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
121 |
languageFileParam, fullScreenParam: string); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
122 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
123 |
setVideoWithParameters(screenWidthParam,screenHeightParam, bitsParam); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
124 |
setAudioWithParameters(initialVolumeParam,musicEnabledParam,soundEnabledParam); |
3858 | 125 |
setOtherOptions(languageFileParam,fullScreenParam = '1') |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
126 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
127 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
128 |
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
|
129 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
130 |
cAltDamage:= altDamage; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
131 |
cTimerInterval:= timeIterval; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
132 |
if (reducedQuality) then //HACK |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
133 |
cReducedQuality:= $FFFFFFFF xor rqLowRes |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
134 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
135 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
136 |
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
|
137 |
initialVolumeParam:string; musicEnabledParam:string; soundEnabledParam:string; |
3858 | 138 |
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
|
139 |
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
|
140 |
var showFPS, altDamage, reducedQuality: boolean; |
7151 | 141 |
timeIterval, c: LongInt; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
142 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
143 |
setMultimediaOptionsWithParameters(screenWidthParam,screenHeightParam, bitsParam, |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
144 |
initialVolumeParam,musicEnabledParam,soundEnabledParam, |
3858 | 145 |
languageFileParam,fullScreenParam); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
146 |
showFPS := showFPSParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
147 |
setShowFPS(showFPS); |
3858 | 148 |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
149 |
altDamage:= altDamageParam = '1'; |
7151 | 150 |
val(timeItervalParam, timeIterval, c); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
151 |
reducedQuality:= reducedQualityParam = '1'; |
3858 | 152 |
setAltDamageTimerValueAndQuality(altDamage,timeIterval,reducedQuality); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
153 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
154 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
155 |
procedure playReplayFileWithParameters(); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
156 |
var paramIndex: LongInt; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
157 |
wrongParameter: boolean; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
158 |
begin |
5239 | 159 |
UserPathPrefix:= ParamStr(1); |
5238
46ddaf14509d
Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents:
5130
diff
changeset
|
160 |
PathPrefix:= ParamStr(2); |
46ddaf14509d
Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents:
5130
diff
changeset
|
161 |
recordFileName:= ParamStr(3); |
46ddaf14509d
Enable ~/.hedgewars/Data (or platform equivalent) to override/extend pretty much everything in system Data dir. Obviously desyncing can occur, so this is at user's own risk. Should simplify map etc install. Needs testing.
nemo
parents:
5130
diff
changeset
|
162 |
paramIndex:= 4; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
163 |
wrongParameter:= false; |
6426 | 164 |
while (paramIndex <= ParamCount) and (not wrongParameter) do |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
165 |
begin |
3858 | 166 |
if ParamStr(paramIndex) = '--set-video' then |
167 |
//--set-video [screen width] [screen height] [color dept] |
|
168 |
begin |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
169 |
if(ParamCount-paramIndex < 3) then |
3858 | 170 |
begin |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
171 |
wrongParameter:= true; |
3858 | 172 |
GameType:= gmtSyntax |
173 |
end; |
|
174 |
setVideoWithParameters(ParamStr(paramIndex+1), ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
|
175 |
paramIndex:= paramIndex + 4 |
|
176 |
end |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
177 |
else |
3858 | 178 |
//--set-audio [volume] [enable music] [enable sounds] |
179 |
if ParamStr(paramIndex) = '--set-audio' then |
|
180 |
begin |
|
181 |
if(ParamCount-paramIndex < 3) then |
|
182 |
begin |
|
183 |
wrongParameter := true; |
|
184 |
GameType:= gmtSyntax |
|
185 |
end; |
|
186 |
setAudioWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
|
187 |
paramIndex:= paramIndex + 4 |
|
188 |
end |
|
189 |
else |
|
190 |
// --set-other [language file] [full screen] [show FPS] |
|
191 |
if ParamStr(paramIndex) = '--set-other' then |
|
192 |
begin |
|
193 |
if(ParamCount-paramIndex < 3) then |
|
194 |
begin |
|
195 |
wrongParameter:= true; |
|
196 |
GameType:= gmtSyntax |
|
197 |
end; |
|
198 |
setOtherOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
|
199 |
paramIndex:= paramIndex + 4 |
|
200 |
end |
|
201 |
else |
|
202 |
//--set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] |
|
203 |
if ParamStr(paramIndex) = '--set-multimedia' then |
|
204 |
begin |
|
205 |
if ParamCount-paramIndex < 8 then |
|
206 |
begin |
|
207 |
wrongParameter:= true; |
|
208 |
GameType:= gmtSyntax |
|
209 |
end; |
|
210 |
setMultimediaOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3), |
|
211 |
ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6), |
|
212 |
ParamStr(paramIndex+7),ParamStr(paramIndex+8)); |
|
213 |
paramIndex:= paramIndex + 9 |
|
214 |
end |
|
215 |
else |
|
216 |
//--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] |
|
217 |
if ParamStr(paramIndex) = '--set-everything' then |
|
218 |
begin |
|
219 |
if ParamCount-paramIndex < 12 then |
|
220 |
begin |
|
221 |
wrongParameter:= true; |
|
222 |
GameType:= gmtSyntax |
|
223 |
end; |
|
224 |
setAllOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3), |
|
225 |
ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6), |
|
226 |
ParamStr(paramIndex+7),ParamStr(paramIndex+8),ParamStr(paramIndex+9), |
|
227 |
ParamStr(paramIndex+10),ParamStr(paramIndex+11),ParamStr(paramIndex+12)); |
|
228 |
paramIndex:= paramIndex + 13 |
|
229 |
end |
|
230 |
else |
|
5130
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
231 |
if ParamStr(paramIndex) = '--stats-only' then |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
232 |
begin |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
233 |
cOnlyStats:= true; |
7021
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
234 |
SetSound(false); |
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
235 |
SetMusic(false); |
5130
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
236 |
cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
237 |
paramIndex:= paramIndex + 1 |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
238 |
end |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
239 |
else |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
240 |
begin |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
241 |
wrongParameter:= true; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
242 |
GameType:= gmtSyntax |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
243 |
end |
3858 | 244 |
end |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
245 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
246 |