diff --git a/src/config.c b/src/config.c index f79357266f..ea93527872 100644 --- a/src/config.c +++ b/src/config.c @@ -86,6 +86,7 @@ general_configuration_t gGeneral_config_default = { 0, // construction_marker_colour 1, // edge_scrolling 0, // always_show_gridlines + 1, // landscape_smoothing }; sound_configuration_t gSound_config; @@ -148,6 +149,14 @@ void config_load() else { RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_ALWAYS_SHOW_GRIDLINES; } + + // landscape smoothing + if (!gGeneral_config.landscape_smoothing){ + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) |= CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE; + } + else { + RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) &= !CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE; + } @@ -327,6 +336,13 @@ void config_write_ini_general(FILE *fp) else { fprintf(fp, "always_show_gridlines = false\n"); } + + if (gGeneral_config.landscape_smoothing){ + fprintf(fp, "landscape_smoothing = true\n"); + } + else { + fprintf(fp, "landscape_smoothing = false\n"); + } } /** @@ -533,6 +549,14 @@ static void config_general(char *setting, char *value){ gGeneral_config.always_show_gridlines = 0; } } + else if (strcmp(setting, "landscape_smoothing") == 0){ + if (strcmp(value, "true") == 0){ + gGeneral_config.landscape_smoothing = 1; + } + else { + gGeneral_config.landscape_smoothing = 0; + } + } } /** diff --git a/src/config.h b/src/config.h index 44079612d4..9bdb7d6f4c 100644 --- a/src/config.h +++ b/src/config.h @@ -137,6 +137,7 @@ typedef struct general_configuration { sint8 construction_marker_colour; sint8 edge_scrolling; sint8 always_show_gridlines; + sint8 landscape_smoothing; } general_configuration_t; static const struct { char *key; int value; } _currencyLookupTable[] = { diff --git a/src/window_options.c b/src/window_options.c index 48175172cf..26f8d4d1d0 100644 --- a/src/window_options.c +++ b/src/window_options.c @@ -249,6 +249,8 @@ static void window_options_mouseup() break; case WIDX_TILE_SMOOTHING_CHECKBOX: RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) ^= CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE; + gGeneral_config.landscape_smoothing = !(RCT2_GLOBAL(RCT2_ADDRESS_CONFIG_FLAGS, uint8) + & CONFIG_FLAG_DISABLE_SMOOTH_LANDSCAPE); config_save(); gfx_invalidate_screen(); break;