author | Joe Doyle (Ginto8) <ginto8@gmail.com> |
Fri, 30 Nov 2012 22:08:06 -0500 | |
changeset 8160 | f837447298c3 |
parent 8150 | 6b30a4cd7c7c |
child 8213 | 81553c5b9fd0 |
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 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
19 |
|
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
20 |
procedure internalStartGameWithParameters(); |
4004
b1c2c2f6fc5e
update branch with latest head, most likely breaking water color in stereo mode
koda
parents:
3858
diff
changeset
|
21 |
var tmp: LongInt; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
22 |
begin |
5239 | 23 |
UserPathPrefix:= ParamStr(1); |
7151 | 24 |
cScreenWidth:= StrToInt(ParamStr(2)); |
25 |
cScreenHeight:= StrToInt(ParamStr(3)); |
|
26 |
cBits:= StrToInt(ParamStr(4)); |
|
27 |
ipcPort:= StrToInt(ParamStr(5)); |
|
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
28 |
cFullScreen:= ParamStr(6) = '1'; |
7021
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
29 |
SetSound(ParamStr(7) = '1'); |
0c75512a8920
adjust the scope of a few uSound variables and functions
koda
parents:
6982
diff
changeset
|
30 |
SetMusic(ParamStr(8) = '1'); |
7151 | 31 |
SetVolume(StrToInt(ParamStr(9))); |
32 |
cTimerInterval:= StrToInt(ParamStr(10)); |
|
3709 | 33 |
PathPrefix:= ParamStr(11); |
34 |
cShowFPS:= ParamStr(12) = '1'; |
|
35 |
cAltDamage:= ParamStr(13) = '1'; |
|
36 |
UserNick:= DecodeBase64(ParamStr(14)); |
|
7151 | 37 |
cReducedQuality:= StrToInt(ParamStr(15)); |
38 |
tmp:= StrToInt(ParamStr(16)); |
|
6982 | 39 |
GrayScale:= false; |
5441
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
40 |
if (tmp > 9) and (tmp < 16) then |
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
41 |
begin |
6982 | 42 |
GrayScale:= true; |
5441
39962b855540
Add grayscale option for 3d, helps with colour clashing
nemo
parents:
5239
diff
changeset
|
43 |
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
|
44 |
end |
6580
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6426
diff
changeset
|
45 |
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
|
46 |
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
|
47 |
else |
6155187bf599
A partial reformatting of the pascal code to have consistent syntax. Things that are still inconsistent.
lovelacer
parents:
6426
diff
changeset
|
48 |
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
|
49 |
cLocaleFName:= ParamStr(17); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
50 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
51 |
|
7198
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
52 |
{$IFDEF USE_VIDEO_RECORDING} |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
53 |
procedure internalStartVideoRecordingWithParameters(); |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
54 |
begin |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
55 |
internalStartGameWithParameters(); |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
56 |
GameType:= gmtRecord; |
7376
48b79b3ca592
rework saving of camera positions so there is no need to know framerate during prerecording.
Stepan777 <stepik-777@mail.ru>
parents:
7306
diff
changeset
|
57 |
cVideoFramerateNum:= StrToInt(ParamStr(18)); |
48b79b3ca592
rework saving of camera positions so there is no need to know framerate during prerecording.
Stepan777 <stepik-777@mail.ru>
parents:
7306
diff
changeset
|
58 |
cVideoFramerateDen:= StrToInt(ParamStr(19)); |
7306
3cff5c769509
Here they come - thumbnails.
Stepan777 <stepik-777@mail.ru>
parents:
7235
diff
changeset
|
59 |
RecPrefix:= ParamStr(20); |
7198
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
60 |
cAVFormat:= ParamStr(21); |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
61 |
cVideoCodec:= ParamStr(22); |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
62 |
cVideoQuality:= StrToInt(ParamStr(23)); |
7376
48b79b3ca592
rework saving of camera positions so there is no need to know framerate during prerecording.
Stepan777 <stepik-777@mail.ru>
parents:
7306
diff
changeset
|
63 |
cAudioCodec:= ParamStr(24); |
7198
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
64 |
end; |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
65 |
{$ENDIF} |
5debd5fe526e
1. Add IFDEFs for video recording
Stepan777 <stepik-777@mail.ru>
parents:
7180
diff
changeset
|
66 |
|
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
67 |
procedure setVideo(screenWidth: LongInt; screenHeight: LongInt; bitsStr: LongInt); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
68 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
69 |
cScreenWidth:= screenWidth; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
70 |
cScreenHeight:= screenHeight; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
71 |
cBits:= bitsStr |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
72 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
73 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
74 |
procedure setVideoWithParameters(screenWidthParam: string; screenHeightParam: string; bitsParam: string); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
75 |
var screenWidthAsInt, screenHeightAsInt, bitsStrAsInt, c: LongInt; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
76 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
77 |
val(screenWidthParam, screenWidthAsInt, c); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
78 |
val(screenHeightParam, screenHeightAsInt, c); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
79 |
val(bitsParam, bitsStrAsInt, c); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
80 |
setVideo(screenWidthAsInt,screenHeightAsInt,bitsStrAsInt) |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
81 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
82 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
83 |
procedure setOtherOptions(languageFile: string; fullScreen: boolean); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
84 |
begin |
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
85 |
cLocaleFName:= languageFile; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
86 |
cFullScreen:= fullScreen |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
87 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
88 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
89 |
procedure setShowFPS(showFPS: boolean); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
90 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
91 |
cShowFPS:= showFPS |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
92 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
93 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
94 |
procedure setOtherOptionsWithParameters(languageFileParam: string; fullScreenParam: string; showFPSParam: string); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
95 |
var fullScreen, showFPS: boolean; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
96 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
97 |
fullScreen:= fullScreenParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
98 |
showFPS:= showFPSParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
99 |
setOtherOptions(languageFileParam,fullScreen); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
100 |
setShowFPS(showFPS) |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
101 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
102 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
103 |
procedure setAudio(initialVolume: LongInt; musicEnabled: boolean; soundEnabled: boolean); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
104 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
105 |
SetVolume(initialVolume); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
106 |
SetMusic(musicEnabled); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
107 |
SetSound(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 |
|
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
110 |
procedure setAudioWithParameters(initialVolumeParam: string; musicEnabledParam: string; soundEnabledParam: string); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
111 |
var initialVolumeAsInt, c: LongInt; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
112 |
musicEnabled, soundEnabled: boolean; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
113 |
begin |
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
114 |
val(initialVolumeParam, initialVolumeAsInt, c); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
115 |
musicEnabled:= musicEnabledParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
116 |
soundEnabled:= soundEnabledParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
117 |
setAudio(initialVolumeAsInt,musicEnabled, soundEnabled) |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
118 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
119 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
120 |
procedure setMultimediaOptionsWithParameters(screenWidthParam, screenHeightParam, bitsParam: string; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
121 |
initialVolumeParam, musicEnabledParam, soundEnabledParam: string; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
122 |
languageFileParam, fullScreenParam: string); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
123 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
124 |
setVideoWithParameters(screenWidthParam,screenHeightParam, bitsParam); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
125 |
setAudioWithParameters(initialVolumeParam,musicEnabledParam,soundEnabledParam); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
126 |
setOtherOptions(languageFileParam,fullScreenParam = '1') |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
127 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
128 |
|
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
129 |
procedure setAltDamageTimerValueAndQuality(altDamage: boolean; timeIterval: LongInt; reducedQuality: boolean); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
130 |
begin |
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
131 |
cAltDamage:= altDamage; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
132 |
cTimerInterval:= timeIterval; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
133 |
if (reducedQuality) then //HACK |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
134 |
cReducedQuality:= $FFFFFFFF xor rqLowRes |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
135 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
136 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
137 |
procedure setAllOptionsWithParameters(screenWidthParam:string; screenHeightParam:string; bitsParam:string; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
138 |
initialVolumeParam:string; musicEnabledParam:string; soundEnabledParam:string; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
139 |
languageFileParam:string; fullScreenParam:string; showFPSParam:string; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
140 |
altDamageParam:string; timeItervalParam:string; reducedQualityParam: string); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
141 |
var showFPS, altDamage, reducedQuality: boolean; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
142 |
timeIterval, c: LongInt; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
143 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
144 |
setMultimediaOptionsWithParameters(screenWidthParam,screenHeightParam, bitsParam, |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
145 |
initialVolumeParam,musicEnabledParam,soundEnabledParam, |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
146 |
languageFileParam,fullScreenParam); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
147 |
showFPS := showFPSParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
148 |
setShowFPS(showFPS); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
149 |
|
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
150 |
altDamage:= altDamageParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
151 |
val(timeItervalParam, timeIterval, c); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
152 |
reducedQuality:= reducedQualityParam = '1'; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
153 |
setAltDamageTimerValueAndQuality(altDamage,timeIterval,reducedQuality); |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
154 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
155 |
|
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
156 |
procedure playReplayFileWithParameters(paramIndex : LongInt); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
157 |
var wrongParameter: boolean; |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
158 |
begin |
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
159 |
WriteLn(stdout,IntToStr(paramIndex)); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
160 |
wrongParameter:= false; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
161 |
while (paramIndex <= ParamCount) and (not wrongParameter) do |
8150 | 162 |
begin |
8160
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
163 |
if ParamStr(paramIndex) = '--set-video' then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
164 |
//--set-video [screen width] [screen height] [color dept] |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
165 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
166 |
if(ParamCount-paramIndex < 3) then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
167 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
168 |
wrongParameter:= true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
169 |
GameType:= gmtSyntax |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
170 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
171 |
setVideoWithParameters(ParamStr(paramIndex+1), ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
172 |
paramIndex:= paramIndex + 4 |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
173 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
174 |
else |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
175 |
//--set-audio [volume] [enable music] [enable sounds] |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
176 |
if ParamStr(paramIndex) = '--set-audio' then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
177 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
178 |
if(ParamCount-paramIndex < 3) then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
179 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
180 |
wrongParameter := true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
181 |
GameType:= gmtSyntax |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
182 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
183 |
setAudioWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
184 |
paramIndex:= paramIndex + 4 |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
185 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
186 |
else |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
187 |
// --set-other [language file] [full screen] [show FPS] |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
188 |
if ParamStr(paramIndex) = '--set-other' then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
189 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
190 |
if(ParamCount-paramIndex < 3) then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
191 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
192 |
wrongParameter:= true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
193 |
GameType:= gmtSyntax |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
194 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
195 |
setOtherOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2), ParamStr(paramIndex+3)); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
196 |
paramIndex:= paramIndex + 4 |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
197 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
198 |
else |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
199 |
//--set-multimedia [screen width] [screen height] [color dept] [volume] [enable music] [enable sounds] [language file] [full screen] |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
200 |
if ParamStr(paramIndex) = '--set-multimedia' then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
201 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
202 |
if ParamCount-paramIndex < 8 then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
203 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
204 |
wrongParameter:= true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
205 |
GameType:= gmtSyntax |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
206 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
207 |
setMultimediaOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3), |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
208 |
ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6), |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
209 |
ParamStr(paramIndex+7),ParamStr(paramIndex+8)); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
210 |
paramIndex:= paramIndex + 9 |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
211 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
212 |
else |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
213 |
//--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] |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
214 |
if ParamStr(paramIndex) = '--set-everything' then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
215 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
216 |
if ParamCount-paramIndex < 12 then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
217 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
218 |
wrongParameter:= true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
219 |
GameType:= gmtSyntax |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
220 |
end; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
221 |
setAllOptionsWithParameters(ParamStr(paramIndex+1),ParamStr(paramIndex+2),ParamStr(paramIndex+3), |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
222 |
ParamStr(paramIndex+4),ParamStr(paramIndex+5),ParamStr(paramIndex+6), |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
223 |
ParamStr(paramIndex+7),ParamStr(paramIndex+8),ParamStr(paramIndex+9), |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
224 |
ParamStr(paramIndex+10),ParamStr(paramIndex+11),ParamStr(paramIndex+12)); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
225 |
paramIndex:= paramIndex + 13 |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
226 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
227 |
else |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
228 |
if ParamStr(paramIndex) = '--stats-only' then |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
229 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
230 |
cOnlyStats:= true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
231 |
SetSound(false); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
232 |
SetMusic(false); |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
233 |
cReducedQuality:= $FFFFFFFF xor rqLowRes; // HACK |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
234 |
paramIndex:= paramIndex + 1 |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
235 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
236 |
else |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
237 |
begin |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
238 |
wrongParameter:= true; |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
239 |
GameType:= gmtSyntax |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
240 |
end |
f837447298c3
Make user folder default to global folder in hwengine
Joe Doyle (Ginto8) <ginto8@gmail.com>
parents:
8150
diff
changeset
|
241 |
end |
3678
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
242 |
end; |
00428183300f
patch by lucass (polished by me) - command line parsing is now much more flexible
koda
parents:
diff
changeset
|
243 |