diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index f71032c3e..3993ec92b 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -1498,17 +1498,6 @@ int app_main(int argc, char const * const * argv) char buffer[BMAX_PATH]; margc = argc; margv = argv; -#ifdef _WIN32 -#endif - - G_ExtPreInit(argc, argv); - -#ifdef DEBUGGINGAIDS - extern int32_t (*check_filename_casing_fn)(void); - check_filename_casing_fn = check_filename_casing; -#endif - - OSD_SetLogFile(APPBASENAME ".log"); OSD_SetFunctions(NULL, NULL, @@ -1571,18 +1560,10 @@ int app_main(int argc, char const * const * argv) OSD_SetParameters(0, 0, 0, 12, 2, 12, OSD_ERROR, OSDTEXT_RED, 0); registerosdcommands(); - char *const setupFileName = Xstrdup(SetupFilename); - char *const p = strtok(setupFileName, "."); - - if (!p || !Bstrcmp(SetupFilename, SETUPFILENAME)) - Bsprintf(buffer, "settings.cfg"); - else - Bsprintf(buffer, "%s_settings.cfg", p); - - Bfree(setupFileName); - - OSD_Exec(buffer); +#if 0 + // todo: Handle more intelligently. OSD_Exec("autoexec.cfg"); +#endif // Not neccessary ? // CONFIG_SetDefaultKeys(keydefaults, true); diff --git a/source/blood/src/common.cpp b/source/blood/src/common.cpp index d9038538d..9f346f41a 100644 --- a/source/blood/src/common.cpp +++ b/source/blood/src/common.cpp @@ -30,6 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "build.h" #include "baselayer.h" +#include "cmdlib.h" #include "palette.h" #ifdef _WIN32 @@ -100,23 +101,10 @@ void G_SetupGlobalPsky(void) g_pskyidx = skyIdx; } -static char g_rootDir[BMAX_PATH]; int32_t g_groupFileHandle; struct strllist* CommandPaths, * CommandGrps; -void G_ExtPreInit(int32_t argc,char const * const * argv) -{ -#ifdef _WIN32 - GetModuleFileNameA(NULL,g_rootDir,BMAX_PATH); - Bcorrectfilename(g_rootDir,1); - //chdir(g_rootDir); -#else - getcwd(g_rootDir,BMAX_PATH); - strcat(g_rootDir,"/"); -#endif -} - void G_ExtInit(void) { char cwd[BMAX_PATH]; @@ -197,7 +185,7 @@ void G_LoadGroups(int32_t autoload) { char cwd[BMAX_PATH]; - Bstrcat(g_rootDir, g_modDir); + FString g_rootDir = progdir + g_modDir; addsearchpath(g_rootDir); // addsearchpath(mod_dir); diff --git a/source/blood/src/common_game.h b/source/blood/src/common_game.h index 1ae528b8a..e57b5a15d 100644 --- a/source/blood/src/common_game.h +++ b/source/blood/src/common_game.h @@ -516,7 +516,6 @@ extern int loaddefinitions_game(const char *fn, int32_t preload); extern void G_AddSearchPaths(void); extern void G_CleanupSearchPaths(void); -extern void G_ExtPreInit(int32_t argc, char const * const * argv); extern void G_ExtInit(void); void G_LoadGroupsInDir(const char *dirname); diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp index 9c0fe412c..69d162e0b 100644 --- a/source/blood/src/config.cpp +++ b/source/blood/src/config.cpp @@ -567,48 +567,6 @@ int CONFIG_ReadSetup(void) void CONFIG_WriteSettings(void) // save binds and aliases to _settings.cfg { - char *ptr = Xstrdup(SetupFilename); - char filename[BMAX_PATH]; - - if (!Bstrcmp(SetupFilename, SETUPFILENAME)) - Bsprintf(filename, "settings.cfg"); - else - Bsprintf(filename, "%s_settings.cfg", strtok(ptr, ".")); - - BFILE *fp = Bfopen(filename, "wt"); - - if (fp) - { - Bfprintf(fp,"unbindall\n"); - - for (int i=0; i_settings.cfg { - char filename[BMAX_PATH]; - - if (!Bstrcmp(g_setupFileName, SETUPFILENAME)) - Bsprintf(filename, "settings.cfg"); - else - Bsprintf(filename, "%s_settings.cfg", strtok(g_setupFileName, ".")); - - buildvfs_FILE fp = buildvfs_fopen_write(filename); - - if (fp) - { - buildvfs_fputstr(fp,"\nunbindall\n"); - - for (int i=0; i_settings.cfg { - int32_t i; - BFILE *fp; - char *ptr = Xstrdup(g_setupFileName); - char tempbuf[128]; - - if (!Bstrcmp(g_setupFileName, SETUPFILENAME)) - Bsprintf(tempbuf, "settings.cfg"); - else Bsprintf(tempbuf, "%s_settings.cfg", strtok(ptr, ".")); - - fp = Bfopen(tempbuf, "wt"); - - if (fp) - { - Bfprintf(fp,"unbindall\n"); - - for (i=0; i