From: Holger Schemel Date: Tue, 8 Mar 2016 23:30:30 +0000 (+0100) Subject: added initial window size to default program config (using .conf) X-Git-Tag: 4.0.0.0-rc1~53 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ec5b593331609b38b793231e43b0bf57ce309eb2;p=rocksndiamonds.git added initial window size to default program config (using .conf) --- diff --git a/src/files.c b/src/files.c index f8b9e8b8..d428ae99 100644 --- a/src/files.c +++ b/src/files.c @@ -8044,8 +8044,10 @@ void SaveScore(int nr) #define SETUP_TOKEN_INT_FALLBACK_MUSIC_FILE 12 #define SETUP_TOKEN_INT_DEFAULT_LEVEL_SERIES 13 #define SETUP_TOKEN_INT_CHOOSE_FROM_TOP_LEVELDIR 14 +#define SETUP_TOKEN_INT_DEFAULT_WINDOW_WIDTH 15 +#define SETUP_TOKEN_INT_DEFAULT_WINDOW_HEIGHT 16 -#define NUM_INTERNAL_SETUP_TOKENS 15 +#define NUM_INTERNAL_SETUP_TOKENS 17 /* options setup */ #define SETUP_TOKEN_OPTIONS_VERBOSE 0 @@ -8217,6 +8219,8 @@ static struct TokenInfo internal_setup_tokens[] = { TYPE_STRING, &sxi.fallback_music_file, "fallback_music_file" }, { TYPE_STRING, &sxi.default_level_series, "default_level_series" }, { TYPE_BOOLEAN,&sxi.choose_from_top_leveldir, "choose_from_top_leveldir" }, + { TYPE_INTEGER,&sxi.default_window_width, "default_window_width" }, + { TYPE_INTEGER,&sxi.default_window_height, "default_window_height" }, }; static struct TokenInfo options_setup_tokens[] = @@ -8379,6 +8383,9 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->internal.default_level_series = getStringCopy(UNDEFINED_LEVELSET); si->internal.choose_from_top_leveldir = FALSE; + si->internal.default_window_width = WIN_XSIZE_DEFAULT; + si->internal.default_window_height = WIN_YSIZE_DEFAULT; + si->options.verbose = FALSE; #if defined(PLATFORM_ANDROID) diff --git a/src/libgame/system.h b/src/libgame/system.h index 1fe8d9f4..1ad2f709 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -968,6 +968,9 @@ struct SetupInternalInfo char *default_level_series; + int default_window_width; + int default_window_height; + boolean choose_from_top_leveldir; }; diff --git a/src/main.c b/src/main.c index aaf7998a..213ba4a0 100644 --- a/src/main.c +++ b/src/main.c @@ -5718,6 +5718,14 @@ static void InitProgramConfig(char *command_filename) userdata_subdir = USERDATA_DIRECTORY_OTHER; #endif + // set default window size (only relevant on program startup) + if (setup.internal.default_window_width != 0 && + setup.internal.default_window_height != 0) + { + WIN_XSIZE = setup.internal.default_window_width; + WIN_YSIZE = setup.internal.default_window_height; + } + InitProgramInfo(command_filename, config_filename, userdata_subdir,