From: Holger Schemel Date: Tue, 10 Jan 2017 07:11:20 +0000 (+0100) Subject: added detection of global (common/system-wide) scores directory X-Git-Tag: 4.0.0.1~1 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=803637f901b7b228091ac27c4b60ba753219d043;p=rocksndiamonds.git added detection of global (common/system-wide) scores directory --- diff --git a/src/init.c b/src/init.c index 5e996f33..29f4fd4b 100644 --- a/src/init.c +++ b/src/init.c @@ -5891,6 +5891,8 @@ void OpenAll() print_timestamp_time("[init setup/config stuff (1)]"); + InitScoresInfo(); + if (options.execute_command) Execute_Command(options.execute_command); diff --git a/src/libgame/system.c b/src/libgame/system.c index 3b206b26..00e9c729 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -98,6 +98,16 @@ void InitProgramInfo(char *argv0, char *config_filename, char *userdata_subdir, program.log_file[LOG_ERR_ID] = program.log_file_default[LOG_ERR_ID] = stderr; } +void InitScoresInfo() +{ + char *global_scores_dir = getPath2(getCommonDataDir(), SCORES_DIRECTORY); + + program.global_scores = directoryExists(global_scores_dir); + program.many_scores_per_name = !program.global_scores; + + free(global_scores_dir); +} + void SetWindowTitle() { program.window_title = program.window_title_function(); diff --git a/src/libgame/system.h b/src/libgame/system.h index 130db06d..fb209d30 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -760,6 +760,9 @@ struct ProgramInfo char *(*window_title_function)(void); void (*exit_message_function)(char *, va_list); void (*exit_function)(int); + + boolean global_scores; + boolean many_scores_per_name; }; struct OptionInfo @@ -1415,6 +1418,7 @@ extern int FrameCounter; void InitProgramInfo(char *, char *, char *, char *, char *, char *, char *, int); +void InitScoresInfo(); void SetWindowTitle(); void InitWindowTitleFunction(char *(*window_title_function)(void));