Skip to content

Commit

Permalink
WIP of xrAI and xrSE_Factory. Remove unused options. Add and correct …
Browse files Browse the repository at this point in the history
…help. Small changes.
  • Loading branch information
intorr committed Jan 1, 2018
1 parent 7da3a99 commit b62d302
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
24 changes: 7 additions & 17 deletions src/utils/xrAI/xrAI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,10 @@ extern void xrCompiler(LPCSTR name, bool draft_mode, bool pure_covers, LPCSTR ou
extern void verify_level_graph(LPCSTR name, bool verbose);

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

void Help() { MessageBox(0, h_str, "Command line options", MB_OK | MB_ICONINFORMATION); }
string_path INI_FILE;
Expand All @@ -63,8 +60,6 @@ void execute(LPSTR cmd)
sscanf(strstr(cmd, "-f") + 2, "%s", name);
else if (strstr(cmd, "-s"))
sscanf(strstr(cmd, "-s") + 2, "%s", name);
else if (strstr(cmd, "-t"))
sscanf(strstr(cmd, "-t") + 2, "%s", name);
else if (strstr(cmd, "-verify"))
sscanf(strstr(cmd, "-verify") + xr_strlen("-verify"), "%s", name);

Expand Down Expand Up @@ -156,7 +151,6 @@ void execute(LPSTR cmd)
void Startup(LPSTR lpCmdLine)
{
string4096 cmd;
BOOL bModifyOptions = FALSE;

xr_strcpy(cmd, lpCmdLine);
_strlwr(cmd);
Expand All @@ -165,20 +159,16 @@ void Startup(LPSTR lpCmdLine)
Help();
return;
}
if ((strstr(cmd, "-f") == 0) && (strstr(cmd, "-g") == 0) && (strstr(cmd, "-m") == 0) && (strstr(cmd, "-s") == 0) &&
(strstr(cmd, "-t") == 0) && (strstr(cmd, "-c") == 0) && (strstr(cmd, "-verify") == 0) &&
(strstr(cmd, "-patch") == 0))
if ((strstr(cmd, "-f") == 0) && (strstr(cmd, "-s") == 0) && (strstr(cmd, "-verify") == 0))
{
Help();
return;
}
if (strstr(cmd, "-o"))
bModifyOptions = TRUE;
Logger.Initialize("xrAI");
u32 dwStartupTime = timeGetTime();
execute(cmd);
// Show statistic
char stats[256];
string256 stats;
u32 dwEndTime = timeGetTime();
xr_sprintf(stats, "Time elapsed: %s", make_time((dwEndTime - dwStartupTime) / 1000).c_str());
Logger.Success(stats);
Expand All @@ -195,5 +185,5 @@ int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLi

Core._destroy();

return (0);
return 0;
}
16 changes: 16 additions & 0 deletions src/utils/xrAI/xrAI_Readme.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
The following keys are supported / required:
-? or -h == this help
-f <NAME> == compile 'level.ai' from 'build.aimap'
-out <FILE> == name of output file (default: 'level.ai')
-draft == do not load and do not process some stages
-pure_covers == <? need investigation ?>
-keep_temp_files == do not delete 'build.aimap' after load
-s <NAME,...> == build game spawn data
-out <FILE> == name of output file (default: 'NAME.spawn')
-start <NAME> == name of game start level
-no_separator_check == do not verify connectivity between levels
-verify <NAME> == verify compiled 'level.ai'
-noverbose == do not print all single linked vertices (print only count)

<NAME> == level name as 'gamedata/levels/<NAME>/'
<FILE> == any file name

0 comments on commit b62d302

Please sign in to comment.