- removed all code related to the -usecwd command line switch.

While feature-wise ok this was far too scattered throughout the frontends and needs to be done in a more concise way.
This commit is contained in:
Christoph Oelckers 2019-10-21 19:51:12 +02:00
parent c342d25879
commit 0d737ee130
11 changed files with 6 additions and 84 deletions

View file

@ -1408,7 +1408,6 @@ void ParseOptions(void)
bNoAutoLoad = true;
break;
case 33:
g_useCwd = true;
break;
case 34:
{
@ -1522,8 +1521,7 @@ int app_main(int argc, char const * const * argv)
ParseOptions();
G_ExtInit();
if (!g_useCwd)
G_AddSearchPaths();
G_AddSearchPaths();
// used with binds for fast function lookup
hash_init(&h_gamefuncs);
@ -1571,9 +1569,6 @@ int app_main(int argc, char const * const * argv)
G_LoadGroups(!bNoAutoLoad && !gSetup.noautoload);
//if (!g_useCwd)
// G_CleanupSearchPaths();
initprintf("Initializing OSD...\n");
//Bsprintf(tempbuf, HEAD2 " %s", s_buildRev);

View file

@ -102,14 +102,11 @@ void G_SetupGlobalPsky(void)
static char g_rootDir[BMAX_PATH];
int g_useCwd;
int32_t g_groupFileHandle;
struct strllist* CommandPaths, * CommandGrps;
void G_ExtPreInit(int32_t argc,char const * const * argv)
{
g_useCwd = G_CheckCmdSwitch(argc, argv, "-usecwd");
#ifdef _WIN32
GetModuleFileNameA(NULL,g_rootDir,BMAX_PATH);
Bcorrectfilename(g_rootDir,1);
@ -153,11 +150,7 @@ void G_ExtInit(void)
}
}
#if defined(_WIN32)
if (!access("user_profiles_enabled", F_OK))
#else
if (g_useCwd == 0 && access("user_profiles_disabled", F_OK))
#endif
{
char *homedir;
int32_t asperr;

View file

@ -31,8 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
extern int g_useCwd;
#define BLOODWIDESCREENDEF "blood_widescreen.def"
#define BYTEVERSION 102

View file

@ -515,7 +515,6 @@ void G_CheckCommandLine(int32_t argc, char const * const * argv)
}
if (!Bstrcasecmp(c+1, "usecwd"))
{
g_useCwd = 1;
i++;
continue;
}

View file

@ -247,15 +247,12 @@ static char g_rootDir[BMAX_PATH];
//char g_modDir[BMAX_PATH] = "/";
int g_useCwd;
static void G_LoadAddon(void);
int32_t g_groupFileHandle;
struct strllist* CommandPaths, * CommandGrps;
void G_ExtPreInit(int32_t argc,char const * const * argv)
{
g_useCwd = G_CheckCmdSwitch(argc, argv, "-usecwd");
#ifdef _WIN32
GetModuleFileNameA(NULL,g_rootDir,BMAX_PATH);
Bcorrectfilename(g_rootDir,1);
@ -304,11 +301,7 @@ void G_ExtInit(void)
}
}
#if defined(_WIN32) && !defined(EDUKE32_STANDALONE)
if (buildvfs_exists("user_profiles_enabled"))
#else
if (g_useCwd == 0 && !buildvfs_exists("user_profiles_disabled"))
#endif
{
char *homedir;
int32_t asperr;

View file

@ -15,9 +15,6 @@
BEGIN_DUKE_NS
extern int g_useCwd;
#define GAMEFLAG_DUKE 0x00000001
#define GAMEFLAG_NAM 0x00000002
#define GAMEFLAG_NAPALM 0x00000004

View file

@ -6332,7 +6332,7 @@ int G_FPSLimit(void)
EDUKE32_STATIC_ASSERT(sizeof(actor_t)%4 == 0);
EDUKE32_STATIC_ASSERT(sizeof(DukePlayer_t)%4 == 0);
int app_main(int argc, char const * const * argv)
int app_main()
{
#ifndef NETCODE_DISABLE
if (enet_initialize() != 0)
@ -6340,32 +6340,8 @@ int app_main(int argc, char const * const * argv)
else atexit(enet_deinitialize);
#endif
#ifdef _WIN32
#ifndef USE_PHYSFS
#ifdef DEBUGGINGAIDS
extern int32_t (*check_filename_casing_fn)(void);
check_filename_casing_fn = check_filename_casing;
#endif
#endif
#endif
G_ExtPreInit(argc, argv);
#ifdef __APPLE__
if (!g_useCwd)
{
char cwd[BMAX_PATH];
char *homedir = Bgethomedir();
if (homedir)
Bsnprintf(cwd, sizeof(cwd), "%s/Library/Logs/" APPBASENAME ".log", homedir);
else
Bstrcpy(cwd, APPBASENAME ".log");
OSD_SetLogFile(cwd);
Xfree(homedir);
}
else
#endif
OSD_SetLogFile(APPBASENAME ".log");
OSD_SetFunctions(GAME_drawosdchar,
@ -6382,8 +6358,7 @@ int app_main(int argc, char const * const * argv)
initprintf(HEAD2 " %s\n", s_buildRev);
PrintBuildInfo();
if (!g_useCwd)
G_AddSearchPaths();
G_AddSearchPaths();
g_skillCnt = 4;
ud.multimode = 1;
@ -6449,8 +6424,7 @@ int app_main(int argc, char const * const * argv)
G_LoadGroups(!g_noAutoLoad && !ud.setup.noautoload);
// flushlogwindow = 1;
if (!g_useCwd)
G_CleanupSearchPaths();
G_CleanupSearchPaths();
#ifndef EDUKE32_STANDALONE
G_SetupCheats();

View file

@ -492,7 +492,6 @@ void G_CheckCommandLine(int32_t argc, char const * const * argv)
}
if (!Bstrcasecmp(c+1, "usecwd"))
{
g_useCwd = 1;
i++;
continue;
}

View file

@ -212,15 +212,12 @@ void G_SetupGlobalPsky(void)
//////////
static char g_rootDir[BMAX_PATH];
int g_useCwd;
static void G_LoadAddon(void);
int32_t g_groupFileHandle;
struct strllist* CommandPaths, * CommandGrps;
void G_ExtPreInit(int32_t argc,char const * const * argv)
{
g_useCwd = G_CheckCmdSwitch(argc, argv, "-usecwd");
#ifdef _WIN32
GetModuleFileNameA(NULL,g_rootDir,BMAX_PATH);
Bcorrectfilename(g_rootDir,1);
@ -264,11 +261,7 @@ void G_ExtInit(void)
}
}
#if defined(_WIN32)
if (!access("user_profiles_enabled", F_OK))
#else
if (g_useCwd == 0 && access("user_profiles_disabled", F_OK))
#endif
{
char *homedir;
int32_t asperr;

View file

@ -13,9 +13,6 @@
BEGIN_RR_NS
extern int g_useCwd;
#define GAMEFLAG_DUKE 0x00000001
#define GAMEFLAG_NAM 0x00000002
#define GAMEFLAG_NAPALM 0x00000004

View file

@ -7715,20 +7715,6 @@ int app_main(int argc, char const * const * argv)
G_ExtPreInit(argc, argv);
#ifdef __APPLE__
if (!g_useCwd)
{
char cwd[BMAX_PATH];
char *homedir = Bgethomedir();
if (homedir)
Bsnprintf(cwd, sizeof(cwd), "%s/Library/Logs/" APPBASENAME ".log", homedir);
else
Bstrcpy(cwd, APPBASENAME ".log");
OSD_SetLogFile(cwd);
Bfree(homedir);
}
else
#endif
OSD_SetLogFile(APPBASENAME ".log");
OSD_SetFunctions(GAME_drawosdchar,
@ -7745,8 +7731,7 @@ int app_main(int argc, char const * const * argv)
initprintf(HEAD2 " %s\n", s_buildRev);
PrintBuildInfo();
if (!g_useCwd)
G_AddSearchPaths();
G_AddSearchPaths();
g_skillCnt = 4;
ud.multimode = 1;
@ -7816,8 +7801,7 @@ int app_main(int argc, char const * const * argv)
G_LoadGroups(!g_noAutoLoad && !ud.setup.noautoload);
// flushlogwindow = 1;
if (!g_useCwd)
G_CleanupSearchPaths();
G_CleanupSearchPaths();
if (RR)
{