diff --git a/data/advanced_preferences.cfg b/data/advanced_preferences.cfg index 6a621f8e763f..8cbd1cb8dfe1 100644 --- a/data/advanced_preferences.cfg +++ b/data/advanced_preferences.cfg @@ -55,13 +55,6 @@ default=yes [/advanced_preference] -[advanced_preference] - field=local_tod_lighting - name= _ "Local time of day area lighting" - type=boolean - default=yes -[/advanced_preference] - [advanced_preference] field=startup_effect name= _ "Show titlescreen animation" diff --git a/src/display.cpp b/src/display.cpp index 7fdc49d0be07..4579dbfe34c2 100644 --- a/src/display.cpp +++ b/src/display.cpp @@ -202,7 +202,6 @@ display::display(const display_context * dc, CVideo& video, boost::weak_ptr display::get_terrain_images(const map_location &loc, timeid, builder_terrain_type); image::light_string lt; - bool use_local_light = local_tod_light_; - if(use_local_light){ - const time_of_day& tod = get_time_of_day(loc); - - //get all the light transitions - map_location adjs[6]; - get_adjacent_tiles(loc,adjs); - for(int d=0; d<6; ++d){ - const time_of_day& atod = get_time_of_day(adjs[d]); - if(atod.color == tod.color) - continue; - if(lt.empty()) { - //color the full hex before adding transitions - tod_color col = tod.color + color_adjust_; - lt = image::get_light_string(6, col.r, col.g, col.b); - } + const time_of_day& tod = get_time_of_day(loc); - // add the directional transitions - tod_color acol = atod.color + color_adjust_; - lt += image::get_light_string(d, acol.r, acol.g, acol.b); + //get all the light transitions + map_location adjs[6]; + get_adjacent_tiles(loc,adjs); + for(int d=0; d<6; ++d){ + const time_of_day& atod = get_time_of_day(adjs[d]); + if(atod.color == tod.color) + continue; + + if(lt.empty()) { + //color the full hex before adding transitions + tod_color col = tod.color + color_adjust_; + lt = image::get_light_string(6, col.r, col.g, col.b); } - if(lt.empty()){ - if(tod.color == get_time_of_day().color) { - use_local_light = false; - } else { - tod_color col = tod.color + color_adjust_; - if(!col.is_zero()){ - // no real lightmap needed but still color the hex - lt = image::get_light_string(-1, col.r, col.g, col.b); - } - } + // add the directional transitions + tod_color acol = atod.color + color_adjust_; + lt += image::get_light_string(d, acol.r, acol.g, acol.b); + } + + if(lt.empty()){ + tod_color col = tod.color + color_adjust_; + if(!col.is_zero()){ + // no real lightmap needed but still color the hex + lt = image::get_light_string(-1, col.r, col.g, col.b); } } @@ -1188,7 +1181,7 @@ std::vector display::get_terrain_images(const map_location &loc, #else surface surf; const bool off_map = image.get_filename() == off_map_name; - if(!use_local_light || off_map) { + if(off_map) { surf = image::get_image(image, off_map ? image::SCALED_TO_HEX : image_type); } else if(lt.empty()) { surf = image::get_image(image, image::SCALED_TO_HEX); @@ -2722,7 +2715,6 @@ void display::draw(bool update,bool force) { return; } set_scontext_unsynced leave_synced_context; - local_tod_light_ = has_time_area() && preferences::get("local_tod_lighting", true); draw_init(); pre_draw(); @@ -2868,10 +2860,9 @@ void display::draw_hex(const map_location& loc) { std::pair overlays = overlays_->equal_range(loc); const bool have_overlays = overlays.first != overlays.second; - bool use_local_light = local_tod_light_; image::light_string lt; - if(have_overlays && use_local_light) { + if(have_overlays) { const time_of_day& loc_tod = get_time_of_day(loc); const tod_color& loc_col = loc_tod.color; @@ -2881,8 +2872,6 @@ void display::draw_hex(const map_location& loc) { // to apply the color_adjust_ ourselves. tod_color col = loc_col + color_adjust_; lt = image::get_light_string(-1, col.r, col.g, col.b); - } else { - use_local_light = false; } } @@ -2898,9 +2887,8 @@ void display::draw_hex(const map_location& loc) { : image::get_texture(overlays.first->second.image, image_type); drawing_buffer_add(LAYER_TERRAIN_BG, loc, xpos, ypos, img); #else - const surface surf = use_local_light - ? image::get_lighted_image(overlays.first->second.image, lt, image::SCALED_TO_HEX) - : image::get_image(overlays.first->second.image, image_type); + const surface surf = + image::get_lighted_image(overlays.first->second.image, lt, image::SCALED_TO_HEX); drawing_buffer_add(LAYER_TERRAIN_BG, loc, xpos, ypos, surf); #endif } diff --git a/src/display.hpp b/src/display.hpp index 50a51e03b65c..e357a2ff2272 100644 --- a/src/display.hpp +++ b/src/display.hpp @@ -834,9 +834,6 @@ class display : public filter_context /** Local cache for preferences::animate_map, since it is constantly queried. */ bool animate_map_; - /** Local cache for preferences "local_tod_lighting" */ - bool local_tod_light_; - private: #ifdef SDL_GPU