New advanced preference to use a local ToD color-shift

Because the memory cost is now acceptable (and only there when playing
maps with big caves using special ToD)
This commit is contained in:
Ali El Gariani 2010-08-16 07:07:51 +00:00
parent 9c4348ac51
commit 037b79e36b
7 changed files with 18 additions and 6 deletions

View file

@ -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,

View file

@ -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"

View file

@ -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"

View file

@ -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<surface> 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

View file

@ -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{

View file

@ -107,7 +107,6 @@ namespace game_config
double hex_brightening = 1.5;
double hex_semi_brightening = 1.25;
bool local_light = false;
std::vector<std::string> 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();

View file

@ -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<Uint32> red_green_scale;