From 89f50aea64a4e4b7836c865d9594a784f9f259b5 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Mon, 12 May 2003 22:46:01 +0000 Subject: [PATCH] added -nohogdir and -userdir options --- ChangeLog | 4 +++- main/inferno.c | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fb606ee..ea6fda09 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2003-05-12 Bradley Bell + * main/inferno.c: added -nohogdir and -userdir options + * main/titles.c: use briefings with no extension 0.2.3: @@ -17,7 +19,7 @@ * main/Makefile.am: make dist fix 0.2.2: - + 2003-04-29 Bradley Bell * configure.ac, 2d/2dsline.c, main/automap.c, libmve/mveplay.c: diff --git a/main/inferno.c b/main/inferno.c index 11962683..30744a99 100644 --- a/main/inferno.c +++ b/main/inferno.c @@ -1,4 +1,4 @@ -/* $Id: inferno.c,v 1.61 2003-04-24 18:19:05 btb Exp $ */ +/* $Id: inferno.c,v 1.62 2003-05-12 22:46:01 btb Exp $ */ /* THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX SOFTWARE CORPORATION ("PARALLAX"). PARALLAX, IN DISTRIBUTING THE CODE TO @@ -916,6 +916,10 @@ void print_commandline_help() printf( " -maxfps %s\n", "Set maximum framerate (1-100)"); printf( " -notitles %s\n", "Do not show titlescreens on startup"); printf( " -hogdir %s\n", "set shared data directory to "); +#ifdef __unix__ + printf( " -nohogdir %s\n", "don't try to use shared data directory"); + printf( " -userdir %s\n", "set user dir to instead of $HOME/.d2x"); +#endif printf( " -ini %s\n", "option file (alternate to command line), defaults to d2x.ini"); printf( " -autodemo %s\n", "Start in demo mode"); printf( " -bigpig %s\n","FIXME: Undocumented"); @@ -1186,11 +1190,16 @@ int main(int argc, char *argv[]) error_init(NULL, NULL); + InitArgs( argc,argv ); + #ifdef __unix__ { char *home = getenv("HOME"); - if (home) { + if ((t = FindArg("-userdir"))) + chdir(Args[t+1]); + + else if (home) { char buf[PATH_MAX + 5]; strcpy(buf, home); @@ -1204,8 +1213,6 @@ int main(int argc, char *argv[]) } #endif - InitArgs( argc,argv ); - if (FindArg("-debug")) con_threshold.value = (float)2; else if (FindArg("-verbose")) @@ -1215,7 +1222,7 @@ int main(int argc, char *argv[]) if ((t=FindArg("-hogdir"))) cfile_use_alternate_hogdir(Args[t+1]); #ifdef __unix__ - else + else if (!FindArg("-nohogdir")) cfile_use_alternate_hogdir(SHAREPATH); #endif -- 2.39.2