-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheuro_cmd.cpp
185 lines (163 loc) · 5.68 KB
/
euro_cmd.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
/* Copyright (C) 1997 Gremlin Interactive Ltd.
* With modifications by Mark E Sowden
*/
#include <stdio.h>
#include <string.h>
#include <string>
#include <locale>
#include "3deng.h"
#include "defines.h"
#include "gamedata.h"
#include "eurodefs.h"
#include "euro_def.h"
#include "euro_fxd.h"
#include "euro_var.h"
//**********************************************************************************************************************
void ProcessCommandLine(int argc, char **argv) {
signed char CommandLineTEAM = -1;
EUROverbose = 0;
EUROconsole = 0;
EUROcommOVERIDE = (char) 128;
// Inputs...
for (int i = 1; i < argc; i++) {
std::locale p;
std::string command = argv[i];
for (char &j : command) {
j = std::tolower(j, p);
}
if (i < (argc - 1)) {
std::string setting = argv[i + 1];
for (char &j : setting) {
j = std::tolower(j, p);
}
if (setting == "bul")
CommandLineTEAM = Bulgaria;
if (setting == "cro")
CommandLineTEAM = Croatia;
if (setting == "cze")
CommandLineTEAM = Czech;
if (setting == "den")
CommandLineTEAM = Denmark;
if (setting == "eng")
CommandLineTEAM = England;
if (setting == "fra")
CommandLineTEAM = France;
if (setting == "ger")
CommandLineTEAM = Germany;
if (setting == "hol")
CommandLineTEAM = Holland;
if (setting == "ita")
CommandLineTEAM = Italy;
if (setting == "por")
CommandLineTEAM = Portugal;
if (setting == "rom")
CommandLineTEAM = Romania;
if (setting == "rus")
CommandLineTEAM = Russia;
if (setting == "sco")
CommandLineTEAM = Scotland;
if (setting == "spa")
CommandLineTEAM = Spain;
if (setting == "swi")
CommandLineTEAM = Switzerland;
if (setting == "tur")
CommandLineTEAM = Turkey;
}
//*****************************
//* *
//* WIREPLAY COMMANDS *
//* *
//*****************************
if (command == "-wireplay") {
printf("Attempting WIREPLAY game.\n");
EUROgameType = EURO_wireplay;
}
if (command == "-network") {
printf("Attempting NETWORK game.\n");
EUROgameType = EURO_network_game;
}
if (command == "-friendly") {
printf("Attempting FRIENDLY game.\n");
EUROgameType = EURO_friendly;
}
if (EUROgameType == EURO_wireplay) {
if (command == "-home") {
if (CommandLineTEAM != -1)
EUROteamA = CommandLineTEAM;
}
if (command == "-away") {
if (CommandLineTEAM != -1)
EUROteamB = CommandLineTEAM;
}
}
//*****************************
//* *
//* GENERAL COMMANDS *
//* *
//*****************************
if (command == "-1player")
EUROnoOfMatchPlyrs = 1;
if (command == "-2players")
EUROnoOfMatchPlyrs = 2;
if (command == "-3players")
EUROnoOfMatchPlyrs = 3;
if (command == "-4players")
EUROnoOfMatchPlyrs = 4;
if (EUROgameType == EURO_championship) {
if (command == "-5players")
EUROnoOfMatchPlyrs = 5;
if (command == "-6players")
EUROnoOfMatchPlyrs = 6;
if (command == "-7players")
EUROnoOfMatchPlyrs = 7;
if (command == "-8players")
EUROnoOfMatchPlyrs = 8;
if (command == "-9players")
EUROnoOfMatchPlyrs = 9;
if (command == "-10players")
EUROnoOfMatchPlyrs = 10;
if (command == "-11players")
EUROnoOfMatchPlyrs = 11;
if (command == "-12players")
EUROnoOfMatchPlyrs = 12;
if (command == "-13players")
EUROnoOfMatchPlyrs = 13;
if (command == "-14players")
EUROnoOfMatchPlyrs = 14;
if (command == "-15players")
EUROnoOfMatchPlyrs = 15;
if (command == "-16players")
EUROnoOfMatchPlyrs = 16;
}
if (command == "-groups")
Menu = GROUP_FIXTURES;
if (command == "-wembley")
Menu = VENUE_FLYTHRU;
if (command == "-modem")
Menu = MODEM_SETUP;
if (command == "-symbols")
EUROsymbol = 1;
if (command == "-v1")
EUROverbose = 1;
if (command == "-console")
EUROconsole = 1;
if (command == "-commtype0")
EUROcommOVERIDE = 0;
if (command == "-commtype1")
EUROcommOVERIDE = 1;
if (command == "-commtype2")
EUROcommOVERIDE = 2;
if (command == "-commtype3")
EUROcommOVERIDE = 3;
if (command == "?") {
printf("\n\n");
printf(" -friendly Defaults to friendly game on execution.\n");
printf(" -network Defaults to network game on execution.\n");
printf(" -wireplay Defaults to wireplay game on execution.\n");
}
}
setup.verbose = EUROverbose;
if (EUROverbose != 0) {
printf("Outputting VERBOSE information.\n");
}
}