2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 16:24:55 +00:00

Updates to support VISI generation

This commit is contained in:
Jack Andersen
2017-02-23 22:27:07 -10:00
parent 9cf2aec5c1
commit 8c3a7da616
10 changed files with 295 additions and 10 deletions

View File

@@ -85,6 +85,9 @@ static void AthenaExc(athena::error::Level level, const char* file,
va_end(ap);
}
static hecl::SystemChar cwdbuf[1024];
hecl::SystemString ExeDir;
#if _WIN32
int wmain(int argc, const wchar_t** argv)
#else
@@ -138,7 +141,6 @@ int main(int argc, const char** argv)
/* Assemble common tool pass info */
ToolPassInfo info;
info.pname = argv[0];
hecl::SystemChar cwdbuf[1024];
if (hecl::Getcwd(cwdbuf, 1024))
{
info.cwd = cwdbuf;
@@ -148,6 +150,13 @@ int main(int argc, const char** argv)
#else
info.cwd += _S('/');
#endif
if (argv[0][0] != _S('/') && argv[0][0] != _S('\\'))
ExeDir = hecl::SystemString(cwdbuf) + _S('/');
hecl::SystemString Argv0(argv[0]);
hecl::SystemString::size_type lastIdx = Argv0.find_last_of(_S("/\\"));
if (lastIdx != hecl::SystemString::npos)
ExeDir.insert(ExeDir.end(), Argv0.begin(), Argv0.begin() + lastIdx);
}
/* Concatenate args */