Skip to content

Commit b62d302

Browse files
committed
WIP of xrAI and xrSE_Factory. Remove unused options. Add and correct help. Small changes.
1 parent 7da3a99 commit b62d302

File tree

2 files changed

+23
-17
lines changed

2 files changed

+23
-17
lines changed

src/utils/xrAI/xrAI.cpp

Lines changed: 7 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,10 @@ extern void xrCompiler(LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR ou
3939
extern void verify_level_graph(LPCSTR name, bool verbose);
4040

4141
static const char* h_str =
42-
"The following keys are supported / required:\n"
43-
"-? or -h == this help\n"
44-
"-f<NAME> == compile level in gamedata/levels/<NAME>/\n"
45-
"-o == modify build options\n"
46-
"-s == build game spawn data\n"
47-
"\n"
48-
"NOTE: The last key is required for any functionality\n";
42+
"-? or -h == this help\n"
43+
"-f <NAME> == compile level.ai\n"
44+
"-s <NAME,...> == build game spawn data\n"
45+
"-verify <NAME> == verify compiled level.ai\n";
4946

5047
void Help() { MessageBox(0, h_str, "Command line options", MB_OK | MB_ICONINFORMATION); }
5148
string_path INI_FILE;
@@ -63,8 +60,6 @@ void execute(LPSTR cmd)
6360
sscanf(strstr(cmd, "-f") + 2, "%s", name);
6461
else if (strstr(cmd, "-s"))
6562
sscanf(strstr(cmd, "-s") + 2, "%s", name);
66-
else if (strstr(cmd, "-t"))
67-
sscanf(strstr(cmd, "-t") + 2, "%s", name);
6863
else if (strstr(cmd, "-verify"))
6964
sscanf(strstr(cmd, "-verify") + xr_strlen("-verify"), "%s", name);
7065

@@ -156,7 +151,6 @@ void execute(LPSTR cmd)
156151
void Startup(LPSTR lpCmdLine)
157152
{
158153
string4096 cmd;
159-
BOOL bModifyOptions = FALSE;
160154

161155
xr_strcpy(cmd, lpCmdLine);
162156
_strlwr(cmd);
@@ -165,20 +159,16 @@ void Startup(LPSTR lpCmdLine)
165159
Help();
166160
return;
167161
}
168-
if ((strstr(cmd, "-f") == 0) && (strstr(cmd, "-g") == 0) && (strstr(cmd, "-m") == 0) && (strstr(cmd, "-s") == 0) &&
169-
(strstr(cmd, "-t") == 0) && (strstr(cmd, "-c") == 0) && (strstr(cmd, "-verify") == 0) &&
170-
(strstr(cmd, "-patch") == 0))
162+
if ((strstr(cmd, "-f") == 0) && (strstr(cmd, "-s") == 0) && (strstr(cmd, "-verify") == 0))
171163
{
172164
Help();
173165
return;
174166
}
175-
if (strstr(cmd, "-o"))
176-
bModifyOptions = TRUE;
177167
Logger.Initialize("xrAI");
178168
u32 dwStartupTime = timeGetTime();
179169
execute(cmd);
180170
// Show statistic
181-
char stats[256];
171+
string256 stats;
182172
u32 dwEndTime = timeGetTime();
183173
xr_sprintf(stats, "Time elapsed: %s", make_time((dwEndTime - dwStartupTime) / 1000).c_str());
184174
Logger.Success(stats);
@@ -195,5 +185,5 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi
195185

196186
Core._destroy();
197187

198-
return (0);
188+
return 0;
199189
}

src/utils/xrAI/xrAI_Readme.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
The following keys are supported / required:
2+
-? or -h == this help
3+
-f <NAME> == compile 'level.ai' from 'build.aimap'
4+
-out <FILE> == name of output file (default: 'level.ai')
5+
-draft == do not load and do not process some stages
6+
-pure_covers == <? need investigation ?>
7+
-keep_temp_files == do not delete 'build.aimap' after load
8+
-s <NAME,...> == build game spawn data
9+
-out <FILE> == name of output file (default: 'NAME.spawn')
10+
-start <NAME> == name of game start level
11+
-no_separator_check == do not verify connectivity between levels
12+
-verify <NAME> == verify compiled 'level.ai'
13+
-noverbose == do not print all single linked vertices (print only count)
14+
15+
<NAME> == level name as 'gamedata/levels/<NAME>/'
16+
<FILE> == any file name

0 commit comments

Comments
 (0)