Skip local light calculation on map not using any ToD areas

This commit is contained in:
Ali El Gariani 2010-09-11 00:36:15 +00:00
parent 9311e5d74d
commit b5a595775c
5 changed files with 12 additions and 1 deletions

View file

@ -1945,7 +1945,7 @@ void display::draw(bool update,bool force) {
return;
}
local_tod_light_ = preferences::get("local_tod_light", false);
local_tod_light_ = has_time_area() && preferences::get("local_tod_light", false);
bool changed = draw_init();
pre_draw();

View file

@ -471,6 +471,8 @@ public:
virtual const time_of_day& get_time_of_day(const map_location& /*loc*/) const;
virtual bool has_time_area() const {return false;};
protected:
/** Clear the screen contents */
void clear_screen();

View file

@ -423,6 +423,11 @@ const time_of_day& game_display::get_time_of_day(const map_location& loc) const
return tod_manager_.get_time_of_day(loc);
}
bool game_display::has_time_area() const
{
return tod_manager_.has_time_area();
}
void game_display::draw_report(reports::TYPE report_num)
{
if(!team_valid()) {

View file

@ -146,6 +146,8 @@ public:
const time_of_day& get_time_of_day(const map_location& loc) const;
bool has_time_area() const;
protected:
/**
* game_display pre_draw does specific things related e.g. to unit rendering

View file

@ -87,6 +87,8 @@ class tod_manager : public savegame::savegame_config
*/
void remove_time_area(const std::string& id);
bool has_time_area() const {return !areas_.empty();};
const std::vector<time_of_day> times() const {return times_;}
//consider tod modifying units (e.g. illuminates)