diff --git a/changelog b/changelog index c147636cb1e..021aa1cde9e 100644 --- a/changelog +++ b/changelog @@ -44,7 +44,7 @@ Version 1.9.0-svn: * Items & scenery: New anvil, and revised trash and lighthouse * Two new flag styles. * Animate terrain in editor - * Underground maps now use a ToD color-shift + * New advanced preference to use a local ToD color-shift * Language and i18n: * Updated translations: British English, Catalan, Chinese (Simplified), Chinese (Traditional), Czech, Dutch, Finnish, French, Galician, German, diff --git a/data/advanced_preferences.cfg b/data/advanced_preferences.cfg index 15109f69f04..c9e3005c625 100644 --- a/data/advanced_preferences.cfg +++ b/data/advanced_preferences.cfg @@ -42,6 +42,14 @@ default=yes [/advanced_preference] +[advanced_preference] + field=local_tod_light + name=_"Local time of day light" + description=_"Local time of day light effect (use more memory)." + type=boolean + default=no +[/advanced_preference] + [advanced_preference] field=startup_effect name=_"Show Titlescreen Animation" diff --git a/data/game_config.cfg b/data/game_config.cfg index 9a53fddd367..a71332dd996 100644 --- a/data/game_config.cfg +++ b/data/game_config.cfg @@ -64,7 +64,6 @@ #temporary disable hex brightening hex_brightening=1.0 hex_semi_brightening=1.25 - local_light=no flag_rgb=flag_green red_green_scale="e60000,ff0000,ff4000,ff8000,ffc000,ffff00,c0ff00,80ff00,40ff00,00ff00,00e600" diff --git a/src/display.cpp b/src/display.cpp index 693e36e2c94..54f8b679489 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -114,6 +114,8 @@ display::display(CVideo& video, const gamemap* map, const config& theme_cfg, con selectedHex_(), mouseoverHex_(), keys_(), + animate_map_(true), + local_tod_light_(false), drawing_buffer_(), map_screenshot_(false), fps_handle_(0), @@ -697,7 +699,7 @@ std::vector display::get_terrain_images(const map_location &loc, std::string color_mod; bool use_lightmap = false; - bool use_local_light = game_config::local_light; + bool use_local_light = local_tod_light_; if(use_local_light){ const time_of_day& tod = get_time_of_day(loc); @@ -1936,6 +1938,9 @@ void display::draw(bool update,bool force) { if (screen_.update_locked()) { return; } + + local_tod_light_ = preferences::get("local_tod_light", false); + bool changed = draw_init(); pre_draw(); // invalidate all that needs to be invalidated diff --git a/src/display.hpp b/src/display.hpp index b1021b1403a..c35ae23b83b 100644 --- a/src/display.hpp +++ b/src/display.hpp @@ -601,6 +601,9 @@ protected: /** Local cache for preferences::animate_map, since it is constantly queried. */ bool animate_map_; + /** Local cache for preferences "local_tod_light" */ + bool local_tod_light_; + public: /** Helper structure for rendering the terrains. */ struct tblit{ diff --git a/src/game_config.cpp b/src/game_config.cpp index 892406235e4..45f95d22093 100644 --- a/src/game_config.cpp +++ b/src/game_config.cpp @@ -107,7 +107,6 @@ namespace game_config double hex_brightening = 1.5; double hex_semi_brightening = 1.25; - bool local_light = false; std::vector foot_speed_prefix; std::string foot_teleport_enter; @@ -217,7 +216,6 @@ namespace game_config xp_bar_scaling = v["xp_bar_scaling"].to_double(0.5); hex_brightening = v["hex_brightening"].to_double(1.5); hex_semi_brightening = v["hex_semi_brightening"].to_double(1.25); - local_light = v["local_light"].to_bool(false); foot_speed_prefix = utils::split(v["footprint_prefix"]); foot_teleport_enter = v["footprint_teleport_enter"].str(); diff --git a/src/game_config.hpp b/src/game_config.hpp index e0f90bc131c..05cec1835fc 100644 --- a/src/game_config.hpp +++ b/src/game_config.hpp @@ -108,7 +108,6 @@ namespace game_config extern double hp_bar_scaling, xp_bar_scaling; extern double hex_brightening; extern double hex_semi_brightening; - extern bool local_light; extern std::string flag_rgb; extern std::vector red_green_scale;