From 98ec7151a26094a50ee90114522b4e5b9ae6014f Mon Sep 17 00:00:00 2001 From: Ali El Gariani Date: Sun, 11 Dec 2011 17:04:30 +0000 Subject: [PATCH] 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" --- data/game_config.cfg | 3 +-- src/display.hpp | 1 - src/editor/editor_display.cpp | 4 ++-- src/game_config.cpp | 6 ++---- src/game_display.cpp | 16 ---------------- src/game_display.hpp | 5 ----- src/image.cpp | 22 +--------------------- src/image.hpp | 3 +-- 8 files changed, 7 insertions(+), 53 deletions(-) diff --git a/data/game_config.cfg b/data/game_config.cfg index 8c23970fcde..a3c1f46508e 100644 --- a/data/game_config.cfg +++ b/data/game_config.cfg @@ -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" diff --git a/src/display.hpp b/src/display.hpp index 8794f52945b..e0e2a2a8435 100644 --- a/src/display.hpp +++ b/src/display.hpp @@ -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); diff --git a/src/editor/editor_display.cpp b/src/editor/editor_display.cpp index 0309e0f0007..1885c6f5720 100644 --- a/src/editor/editor_display.cpp +++ b/src/editor/editor_display.cpp @@ -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; } diff --git a/src/game_config.cpp b/src/game_config.cpp index 57843cbed1d..cf1718bc5c1 100644 --- a/src/game_config.cpp +++ b/src/game_config.cpp @@ -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 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(); diff --git a/src/game_display.cpp b/src/game_display.cpp index 261ec3f18f5..1dd6636fa7a 100644 --- a/src/game_display.cpp +++ b/src/game_display.cpp @@ -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_); diff --git a/src/game_display.hpp b/src/game_display.hpp index 71d0ddf7343..726e4e0313f 100644 --- a/src/game_display.hpp +++ b/src/game_display.hpp @@ -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(); diff --git a/src/image.cpp b/src/image.cpp index 9cc8b3946de..3bbc484e464 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -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; } diff --git a/src/image.hpp b/src/image.hpp index 0ba6fc9b71b..638b0162cff 100644 --- a/src/image.hpp +++ b/src/image.hpp @@ -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