return user_game_data_dir;
}
-void updateUserGameDataDir()
-{
-#if defined(PLATFORM_MACOSX)
- char *userdata_dir_old = getPath2(getHomeDir(), program.userdata_subdir_unix);
- char *userdata_dir_new = getUserGameDataDir(); /* do not free() this */
-
- /* convert old Unix style game data directory to Mac OS X style, if needed */
- if (directoryExists(userdata_dir_old) && !directoryExists(userdata_dir_new))
- {
- if (rename(userdata_dir_old, userdata_dir_new) != 0)
- {
- Error(ERR_WARN, "cannot move game data directory '%s' to '%s'",
- userdata_dir_old, userdata_dir_new);
-
- /* continue using Unix style data directory -- this should not happen */
- program.userdata_path = getPath2(getPersonalDataDir(),
- program.userdata_subdir_unix);
- }
- }
-
- free(userdata_dir_old);
-#endif
-}
-
char *getSetupDir()
{
return getUserGameDataDir();
char *getSetupDir(void);
char *getCurrentLevelDir(void);
-void updateUserGameDataDir(void);
-
void createDirectory(char *, char *, int);
void InitUserDataDirectory(void);
void SetFilePermissions(char *, int);
/* init/close functions */
/* ========================================================================= */
-void InitProgramInfo(char *argv0, char *config_filename,
- char *userdata_subdir, char *userdata_subdir_unix,
+void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir,
char *program_title, char *icon_title,
char *icon_filename, char *cookie_prefix,
int program_version)
program.config_filename = config_filename;
program.userdata_subdir = userdata_subdir;
- program.userdata_subdir_unix = userdata_subdir_unix;
program.userdata_path = getUserGameDataDir();
program.program_title = program_title;
// this is initialized in GetOptions(), but may already be used before
options.verbose = TRUE;
-#if defined(PLATFORM_MACOSX)
- updateUserGameDataDir();
-#endif
-
OpenLogFiles();
#if defined(TARGET_SDL2)
char *maindata_path; /* main game data (installation) directory */
char *userdata_subdir; /* personal user game data directory */
- char *userdata_subdir_unix; /* personal user game data directory (Unix) */
char *userdata_path; /* resulting full path to game data directory */
char *program_title;
/* function definitions */
void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *,
- char *, int);
+ int);
void SetWindowTitle();
static void InitProgramConfig(char *command_filename)
{
- char *userdata_basename = getBaseNameNoSuffix(command_filename);
- char *config_filename = getProgramConfigFilename(command_filename);
char *program_title = PROGRAM_TITLE_STRING;
char *program_icon_file = PROGRAM_ICON_FILENAME;
+ char *config_filename = getProgramConfigFilename(command_filename);
+ char *userdata_basename = getBaseNameNoSuffix(command_filename);
char *userdata_subdir;
char *userdata_subdir_unix;
InitProgramInfo(command_filename,
config_filename,
userdata_subdir,
- userdata_subdir_unix,
program_title,
program_title,
program_icon_file,