Fix lingering dead code for brightened hexes.

It was disabled since the new golden hex cursor. Also rename
"semi-brightened" (still used for editor selection) as "brightened"
This commit is contained in:
Ali El Gariani 2011-12-11 17:04:30 +00:00
parent b091953eee
commit 98ec7151a2
8 changed files with 7 additions and 53 deletions

View file

@ -31,8 +31,7 @@
xp_bar_scaling=0.5
#temporary disable hex brightening
hex_brightening=1.0
hex_semi_brightening=1.25
hex_brightening=1.25
flag_rgb=flag_green
red_green_scale="e60000,ff0000,ff4000,ff8000,ffc000,ffff00,c0ff00,80ff00,40ff00,00ff00,00e600"

View file

@ -526,7 +526,6 @@ protected:
/**
* @returns the image type to be used for the passed hex
* (mostly to do with brightening like for mouseover)
*/
virtual image::TYPE get_image_type(const map_location& loc);

View file

@ -64,9 +64,9 @@ void editor_display::pre_draw()
image::TYPE editor_display::get_image_type(const map_location& loc)
{
if (brush_locations_.find(loc) != brush_locations_.end()) {
return image::BRIGHTENED;
return image::TOD_COLORED;
} else if (map().in_selection(loc)) {
return image::SEMI_BRIGHTENED;
return image::BRIGHTENED;
}
return image::TOD_COLORED;
}

View file

@ -109,8 +109,7 @@ namespace game_config
double hp_bar_scaling = 0.666;
double xp_bar_scaling = 0.5;
double hex_brightening = 1.5;
double hex_semi_brightening = 1.25;
double hex_brightening = 1.25;
std::vector<std::string> foot_speed_prefix;
std::string foot_teleport_enter;
@ -213,8 +212,7 @@ namespace game_config
hp_bar_scaling = v["hp_bar_scaling"].to_double(0.666);
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);
hex_brightening = v["hex_brightening"].to_double(1.25);
foot_speed_prefix = utils::split(v["footprint_prefix"]);
foot_teleport_enter = v["footprint_teleport_enter"].str();

View file

@ -282,22 +282,6 @@ void game_display::pre_draw() {
prune_chat_messages();
}
image::TYPE game_display::get_image_type(const map_location& loc) {
// We highlight hex under the mouse, or under a selected unit.
if (get_map().on_board(loc)) {
if (loc == mouseoverHex_ || loc == attack_indicator_src_) {
return image::BRIGHTENED;
} else if (loc == selectedHex_) {
const unit *un = get_visible_unit(loc, teams_[currentTeam_], !viewpoint_);
if (un && !un->get_hidden()) {
return image::BRIGHTENED;
}
}
}
return image::TOD_COLORED;
}
void game_display::draw_invalidated()
{
halo::unrender(invalidated_);

View file

@ -141,11 +141,6 @@ protected:
*/
void pre_draw();
/**
* Hex brightening for game - take units into account
*/
image::TYPE get_image_type(const map_location& loc);
void draw_invalidated();
void post_commit();

View file

@ -113,8 +113,7 @@ image::image_cache images_,
hexed_images_,
scaled_to_hex_images_,
tod_colored_images_,
brightened_images_,
semi_brightened_images_;
brightened_images_;
// cache storing if each image fit in a hex
image::bool_cache in_hex_info_;
@ -159,7 +158,6 @@ void flush_cache()
scaled_to_zoom_.flush();
scaled_to_hex_images_.flush();
brightened_images_.flush();
semi_brightened_images_.flush();
in_hex_info_.flush();
mini_terrain_cache.clear();
mini_fogged_terrain_cache.clear();
@ -575,7 +573,6 @@ void set_color_adjustment(int r, int g, int b)
blue_adjust = b;
tod_colored_images_.flush();
brightened_images_.flush();
semi_brightened_images_.flush();
reversed_images_.clear();
}
}
@ -610,7 +607,6 @@ void set_zoom(int amount)
zoom = amount;
tod_colored_images_.flush();
brightened_images_.flush();
semi_brightened_images_.flush();
reversed_images_.clear();
// We keep these caches if:
@ -663,12 +659,6 @@ static surface get_brightened(const locator& i_locator)
return surface(brighten_image(image, ftofxp(game_config::hex_brightening)));
}
static surface get_semi_brightened(const locator& i_locator)
{
surface image(get_image(i_locator, TOD_COLORED));
return surface(brighten_image(image, ftofxp(game_config::hex_semi_brightening)));
}
///translate type to a simpler one when possible
static TYPE simplify_type(const image::locator& i_locator, TYPE type){
switch(type) {
@ -680,10 +670,6 @@ static TYPE simplify_type(const image::locator& i_locator, TYPE type){
if(ftofxp(game_config::hex_brightening) == ftofxp(1.0))
type = TOD_COLORED;
break;
case SEMI_BRIGHTENED:
if(ftofxp(game_config::hex_semi_brightening) == ftofxp(1.0))
type = TOD_COLORED;
break;
default:
break;
}
@ -738,9 +724,6 @@ surface get_image(const image::locator& i_locator, TYPE type)
case BRIGHTENED:
imap = &brightened_images_;
break;
case SEMI_BRIGHTENED:
imap = &semi_brightened_images_;
break;
default:
return res;
}
@ -782,9 +765,6 @@ surface get_image(const image::locator& i_locator, TYPE type)
case BRIGHTENED:
res = get_brightened(i_locator);
break;
case SEMI_BRIGHTENED:
res = get_semi_brightened(i_locator);
break;
default:
return res;
}

View file

@ -185,8 +185,7 @@ namespace image {
/// SCALED_TO_HEX : image will be scaled to fit into a hex, taking zoom into account
/// TOD_COLORED : same as SCALED_TO_HEX but ToD coloring is also applied
/// BRIGHTENED : same as TOD_COLORED but also brightened
/// SEMI_BRIGHTENED : same as TOD_COLORED but also semi-brightened
enum TYPE { UNSCALED, SCALED_TO_ZOOM, HEXED, SCALED_TO_HEX, TOD_COLORED, BRIGHTENED, SEMI_BRIGHTENED};
enum TYPE { UNSCALED, SCALED_TO_ZOOM, HEXED, SCALED_TO_HEX, TOD_COLORED, BRIGHTENED};
///function to get the surface corresponding to an image.
///note that this surface must be freed by the user by calling