the folder for save/load and default config set to '.'

This commit is contained in:
ozkl 2019-08-18 15:28:49 +03:00
parent afc47e5268
commit 470823b640
3 changed files with 9 additions and 29 deletions

View File

@ -97,4 +97,4 @@
#undef ORIGCODE #undef ORIGCODE
/* Define to the directory where all game files are located */ /* Define to the directory where all game files are located */
#define FILES_DIR "/mnt" #define FILES_DIR "."

View File

@ -429,6 +429,8 @@ static char *CheckDirectoryHasIWAD(char *dir, char *iwadname)
filename = M_StringJoin(dir, DIR_SEPARATOR_S, iwadname, NULL); filename = M_StringJoin(dir, DIR_SEPARATOR_S, iwadname, NULL);
} }
printf("Trying IWAD file:%s\n", filename);
if (M_FileExists(filename)) if (M_FileExists(filename))
{ {
return filename; return filename;
@ -611,8 +613,6 @@ static void BuildIWADDirList(void)
#endif #endif
#else #else
AddIWADDir(".");
AddIWADDir (FILES_DIR); AddIWADDir (FILES_DIR);
// Don't run this function again. // 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 // Search through the list and look for an IWAD
printf("-iwad not specified, trying a few iwad names\n");
result = NULL; result = NULL;
BuildIWADDirList(); BuildIWADDirList();

View File

@ -2042,33 +2042,11 @@ float M_GetFloatVariable(char *name)
static char *GetDefaultConfigDir(void) static char *GetDefaultConfigDir(void)
{ {
#if !defined(_WIN32) || defined(_WIN32_WCE) char *result = (char *)malloc(2);
result[0] = '.';
// Configuration settings are stored in ~/.chocolate-doom/, result[1] = '\0';
// 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; return result;
}
else
#endif /* #ifndef _WIN32 */
{
return strdup(FILES_DIR"/");
}
} }
// //