From 470823b6408a4c613036736d7fe44bcddf71d837 Mon Sep 17 00:00:00 2001 From: ozkl Date: Sun, 18 Aug 2019 15:28:49 +0300 Subject: [PATCH] the folder for save/load and default config set to '.' --- doomgeneric/config.h | 2 +- doomgeneric/d_iwad.c | 6 ++++-- doomgeneric/m_config.c | 30 ++++-------------------------- 3 files changed, 9 insertions(+), 29 deletions(-) diff --git a/doomgeneric/config.h b/doomgeneric/config.h index 6fe8481..7e05102 100644 --- a/doomgeneric/config.h +++ b/doomgeneric/config.h @@ -97,4 +97,4 @@ #undef ORIGCODE /* Define to the directory where all game files are located */ -#define FILES_DIR "/mnt" +#define FILES_DIR "." diff --git a/doomgeneric/d_iwad.c b/doomgeneric/d_iwad.c index 04389a9..9da6337 100644 --- a/doomgeneric/d_iwad.c +++ b/doomgeneric/d_iwad.c @@ -429,6 +429,8 @@ static char *CheckDirectoryHasIWAD(char *dir, char *iwadname) filename = M_StringJoin(dir, DIR_SEPARATOR_S, iwadname, NULL); } + printf("Trying IWAD file:%s\n", filename); + if (M_FileExists(filename)) { return filename; @@ -611,8 +613,6 @@ static void BuildIWADDirList(void) #endif #else - AddIWADDir("."); - AddIWADDir (FILES_DIR); // Don't run this function again. @@ -735,6 +735,8 @@ char *D_FindIWAD(int mask, GameMission_t *mission) { // Search through the list and look for an IWAD + printf("-iwad not specified, trying a few iwad names\n"); + result = NULL; BuildIWADDirList(); diff --git a/doomgeneric/m_config.c b/doomgeneric/m_config.c index 31ac7a6..d35a02b 100644 --- a/doomgeneric/m_config.c +++ b/doomgeneric/m_config.c @@ -2042,33 +2042,11 @@ float M_GetFloatVariable(char *name) static char *GetDefaultConfigDir(void) { -#if !defined(_WIN32) || defined(_WIN32_WCE) + char *result = (char *)malloc(2); + result[0] = '.'; + result[1] = '\0'; - // Configuration settings are stored in ~/.chocolate-doom/, - // except on Windows, where we behave like Vanilla Doom and - // save in the current directory. - - char *homedir; - char *result; - - // frosted HACK - homedir = getenv("HOME"); - homedir = "/mnt"; - - if (homedir != NULL) - { - // put all configuration in a config directory off the - // homedir - - result = M_StringJoin(homedir, DIR_SEPARATOR_S, - "." PACKAGE_TARNAME, DIR_SEPARATOR_S, NULL); - - return result; - } - else -#endif /* #ifndef _WIN32 */ - { - return strdup(FILES_DIR"/"); - } + return result; } //