OS X: Write eduke32.log to ~/Library/Logs unless -usecwd is given.

git-svn-id: https://svn.eduke32.com/eduke32@3689 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2013-04-17 20:34:39 +00:00
parent 3c5c8b44dc
commit 34a965721b

View file

@ -8729,6 +8729,17 @@ static int32_t loaddefinitions_game(const char *fn, int32_t preload)
const char **g_argv;
#endif
#ifdef __APPLE__
// Early checking for "-usecwd" switch.
static void G_CheckUseCWD(int32_t argc, const char **argv)
{
int32_t i;
for (i=0; i<argc; i++)
if (!Bstrcasecmp(argv[i], "-usecwd"))
usecwd = 1;
}
#endif
static void G_CheckCommandLine(int32_t argc, const char **argv)
{
int16_t i = 1, j;
@ -10239,7 +10250,23 @@ int32_t app_main(int32_t argc, const char **argv)
strcat(g_rootDir,"/");
#endif
OSD_SetParameters(0,0, 0,12, 2,12);
#ifdef __APPLE__
G_CheckUseCWD(argc, argv);
if (!usecwd)
{
char *homedir = Bgethomedir();
if (homedir)
Bsnprintf(cwd, sizeof(cwd), "%s/Library/Logs/eduke32.log", homedir);
else
Bstrcpy(cwd, "eduke32.log");
OSD_SetLogFile(cwd);
Bfree(homedir);
}
else
#endif
OSD_SetLogFile("eduke32.log");
OSD_SetFunctions(
GAME_drawosdchar,
GAME_drawosdstr,