1+ #include < math.h>
2+
3+ #include < malloc.h>
4+ #include " core/VirtualStream.h"
5+ #include " core/cmdlib.h"
6+ #include " math/dktypes.h"
7+ #include " util/image.h"
8+ #include " util/util.h"
9+ #include < string>
10+ #include < DriverLevelTool/driver_routines/d2_types.h>
11+
12+ // ----------------------------------------------------
13+
14+ void CompileMissionBlk (const char * filename)
15+ {
16+ }
17+
18+ void DecompileMissionBlk (const char * filename, int missionNumber)
19+ {
20+ if (missionNumber <= 0 ) // decompile all
21+ {
22+
23+ }
24+ }
25+
26+ // -----------------------------------------------------
27+
28+ void PrintCommandLineArguments ()
29+ {
30+ MsgInfo (" Example usage:\n " );
31+ MsgInfo (" \t Driver2MissionTool -decompile MISSIONS.BLK [mission_number]\n " );
32+ MsgInfo (" \t Driver2MissionTool -compile <mission_script_name.d2ms>\n " );
33+ }
34+
35+ int main (int argc, char ** argv)
36+ {
37+ #ifdef _WIN32
38+ Install_ConsoleSpewFunction ();
39+ #endif
40+
41+ Msg (" ---------------\n DriverMissionTool - Driver 2 mission decompiler\n ---------------\n\n " );
42+
43+ if (argc <= 1 )
44+ {
45+ PrintCommandLineArguments ();
46+ return -1 ;
47+ }
48+
49+ for (int i = 0 ; i < argc; i++)
50+ {
51+ if (!stricmp (argv[i], " -compile" ))
52+ {
53+ if (i + 1 <= argc)
54+ CompileMission (argv[i + 1 ]);
55+ else
56+ MsgWarning (" -compile must have an argument!" );
57+ }
58+ else if (!stricmp (argv[i], " -decompile" ))
59+ {
60+ if (i + 1 <= argc)
61+ DecompileMissionBlk (argv[i + 1 ], atoi (argv[i + 2 ]));
62+ else
63+ MsgWarning (" -decompile must have at least one argument!" );
64+ }
65+ }
66+
67+ return 0 ;
68+ }
0 commit comments