author | Xeli |
Fri, 01 Jul 2011 08:46:47 +0200 | |
branch | hedgeroid |
changeset 5385 | a864a0aeed96 |
parent 5239 | f34f391a223b |
child 5441 | 39962b855540 |
permissions | -rw-r--r-- |
4976 | 1 |
(* |
2 |
* Hedgewars, a free turn based strategy game |
|
3 |
* Copyright (c) 2004-2011 Andrey Korotaev <unC0Rr@gmail.com> |
|
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 |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
27 |
val(ParamStr(2), ipcPort); |
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); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
38 |
val(ParamStr(2), cScreenWidth); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
39 |
val(ParamStr(3), cScreenHeight); |
3709 | 40 |
val(ParamStr(4), cBits); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
41 |
val(ParamStr(5), ipcPort); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
42 |
cFullScreen:= ParamStr(6) = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
43 |
isSoundEnabled:= ParamStr(7) = '1'; |
3709 | 44 |
isMusicEnabled:= ParamStr(8) = '1'; |
45 |
val(ParamStr(9), cInitVolume); |
|
46 |
val(ParamStr(10), cTimerInterval); |
|
47 |
PathPrefix:= ParamStr(11); |
|
48 |
cShowFPS:= ParamStr(12) = '1'; |
|
49 |
cAltDamage:= ParamStr(13) = '1'; |
|
50 |
UserNick:= DecodeBase64(ParamStr(14)); |
|
51 |
val(ParamStr(15), cReducedQuality); |
|
4004
b1c2c2f6fc5e
update branch with latest head, most likely breaking water color in stereo mode
koda
parents:
3858
diff
changeset
|
52 |
val(ParamStr(16), tmp); |
b1c2c2f6fc5e
update branch with latest head, most likely breaking water color in stereo mode
koda
parents:
3858
diff
changeset
|
53 |
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
|
54 |
cLocaleFName:= ParamStr(17); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
55 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
56 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
57 |
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
|
58 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
59 |
cScreenWidth:= screenWidth; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
60 |
cScreenHeight:= screenHeight; |
3858 | 61 |
cBits:= bitsStr |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
62 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
63 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
64 |
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
|
65 |
var screenWidthAsInt, screenHeightAsInt, bitsStrAsInt: LongInt; |
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 |
val(screenWidthParam, screenWidthAsInt); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
68 |
val(screenHeightParam, screenHeightAsInt); |
3709 | 69 |
val(bitsParam, bitsStrAsInt); |
3858 | 70 |
setVideo(screenWidthAsInt,screenHeightAsInt,bitsStrAsInt) |
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 setOtherOptions(languageFile: string; fullScreen: boolean); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
74 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
75 |
cLocaleFName:= languageFile; |
3858 | 76 |
cFullScreen:= fullScreen |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
77 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
78 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
79 |
procedure setShowFPS(showFPS: boolean); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
80 |
begin |
3858 | 81 |
cShowFPS:= showFPS |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
82 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
83 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
84 |
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
|
85 |
var fullScreen, showFPS: boolean; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
86 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
87 |
fullScreen:= fullScreenParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
88 |
showFPS:= showFPSParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
89 |
setOtherOptions(languageFileParam,fullScreen); |
3858 | 90 |
setShowFPS(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 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
|
94 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
95 |
cInitVolume:= initialVolume; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
96 |
isMusicEnabled:= musicEnabled; |
3858 | 97 |
isSoundEnabled:= soundEnabled |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
98 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
99 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
100 |
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
|
101 |
var initialVolumeAsInt: LongInt; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
102 |
musicEnabled, soundEnabled: boolean; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
103 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
104 |
val(initialVolumeParam, initialVolumeAsInt); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
105 |
musicEnabled:= musicEnabledParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
106 |
soundEnabled:= soundEnabledParam = '1'; |
3858 | 107 |
setAudio(initialVolumeAsInt,musicEnabled, soundEnabled) |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
108 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
109 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
110 |
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
|
111 |
initialVolumeParam, musicEnabledParam, soundEnabledParam: string; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
112 |
languageFileParam, fullScreenParam: string); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
113 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
114 |
setVideoWithParameters(screenWidthParam,screenHeightParam, bitsParam); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
115 |
setAudioWithParameters(initialVolumeParam,musicEnabledParam,soundEnabledParam); |
3858 | 116 |
setOtherOptions(languageFileParam,fullScreenParam = '1') |
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 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
|
120 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
121 |
cAltDamage:= altDamage; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
122 |
cTimerInterval:= timeIterval; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
123 |
if (reducedQuality) then //HACK |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
124 |
cReducedQuality:= $FFFFFFFF xor rqLowRes |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
125 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
126 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
127 |
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
|
128 |
initialVolumeParam:string; musicEnabledParam:string; soundEnabledParam:string; |
3858 | 129 |
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
|
130 |
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
|
131 |
var showFPS, altDamage, reducedQuality: boolean; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
132 |
timeIterval: LongInt; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
133 |
begin |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
134 |
setMultimediaOptionsWithParameters(screenWidthParam,screenHeightParam, bitsParam, |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
135 |
initialVolumeParam,musicEnabledParam,soundEnabledParam, |
3858 | 136 |
languageFileParam,fullScreenParam); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
137 |
showFPS := showFPSParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
138 |
setShowFPS(showFPS); |
3858 | 139 |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
140 |
altDamage:= altDamageParam = '1'; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
141 |
val(timeItervalParam, timeIterval); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
142 |
reducedQuality:= reducedQualityParam = '1'; |
3858 | 143 |
setAltDamageTimerValueAndQuality(altDamage,timeIterval,reducedQuality); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
144 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
145 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
146 |
procedure playReplayFileWithParameters(); |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
147 |
var paramIndex: LongInt; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
148 |
wrongParameter: boolean; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
149 |
begin |
5239 | 150 |
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
|
151 |
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
|
152 |
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
|
153 |
paramIndex:= 4; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
154 |
wrongParameter:= false; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
155 |
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
|
156 |
begin |
3858 | 157 |
if ParamStr(paramIndex) = '--set-video' then |
158 |
//--set-video [screen width] [screen height] [color dept] |
|
159 |
begin |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
160 |
if(ParamCount-paramIndex < 3) then |
3858 | 161 |
begin |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
162 |
wrongParameter:= true; |
3858 | 163 |
GameType:= gmtSyntax |
164 |
end; |
|
165 |
setVideoWithParameters(ParamStr(paramIndex+1), ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
|
166 |
paramIndex:= paramIndex + 4 |
|
167 |
end |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
168 |
else |
3858 | 169 |
//--set-audio [volume] [enable music] [enable sounds] |
170 |
if ParamStr(paramIndex) = '--set-audio' then |
|
171 |
begin |
|
172 |
if(ParamCount-paramIndex < 3) then |
|
173 |
begin |
|
174 |
wrongParameter := true; |
|
175 |
GameType:= gmtSyntax |
|
176 |
end; |
|
177 |
setAudioWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
|
178 |
paramIndex:= paramIndex + 4 |
|
179 |
end |
|
180 |
else |
|
181 |
// --set-other [language file] [full screen] [show FPS] |
|
182 |
if ParamStr(paramIndex) = '--set-other' then |
|
183 |
begin |
|
184 |
if(ParamCount-paramIndex < 3) then |
|
185 |
begin |
|
186 |
wrongParameter:= true; |
|
187 |
GameType:= gmtSyntax |
|
188 |
end; |
|
189 |
setOtherOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
|
190 |
paramIndex:= paramIndex + 4 |
|
191 |
end |
|
192 |
else |
|
193 |
//--set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] |
|
194 |
if ParamStr(paramIndex) = '--set-multimedia' then |
|
195 |
begin |
|
196 |
if ParamCount-paramIndex < 8 then |
|
197 |
begin |
|
198 |
wrongParameter:= true; |
|
199 |
GameType:= gmtSyntax |
|
200 |
end; |
|
201 |
setMultimediaOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3), |
|
202 |
ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6), |
|
203 |
ParamStr(paramIndex+7),ParamStr(paramIndex+8)); |
|
204 |
paramIndex:= paramIndex + 9 |
|
205 |
end |
|
206 |
else |
|
207 |
//--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] |
|
208 |
if ParamStr(paramIndex) = '--set-everything' then |
|
209 |
begin |
|
210 |
if ParamCount-paramIndex < 12 then |
|
211 |
begin |
|
212 |
wrongParameter:= true; |
|
213 |
GameType:= gmtSyntax |
|
214 |
end; |
|
215 |
setAllOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3), |
|
216 |
ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6), |
|
217 |
ParamStr(paramIndex+7),ParamStr(paramIndex+8),ParamStr(paramIndex+9), |
|
218 |
ParamStr(paramIndex+10),ParamStr(paramIndex+11),ParamStr(paramIndex+12)); |
|
219 |
paramIndex:= paramIndex + 13 |
|
220 |
end |
|
221 |
else |
|
5130
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
222 |
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
|
223 |
begin |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
224 |
cOnlyStats:= true; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
225 |
isSoundEnabled:= false; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
226 |
isMusicEnabled:= false; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
227 |
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
|
228 |
paramIndex:= paramIndex + 1 |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
229 |
end |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
230 |
else |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
231 |
begin |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
232 |
wrongParameter:= true; |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
233 |
GameType:= gmtSyntax |
3602ede67ec5
Add a parameter for game simulation with no gui/sound enabled, just to get statistics
unc0rr
parents:
4976
diff
changeset
|
234 |
end |
3858 | 235 |
end |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
236 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
237 |