Fix mouseover golden hex decapitating big unit on keep...

...by using the same trick as for grid and ellipse (2 top/bottom
layers).  Slight little inconvenience is that it still need to
decapitate unit at the edge of fog/shroud. But it's rare enough (need
big unit on keep there)
This commit is contained in:
Ali El Gariani 2010-08-18 00:09:29 +00:00
parent 3bdadce2a0
commit a5dd484e31
6 changed files with 18 additions and 16 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

View file

@ -2087,10 +2087,23 @@ void display::draw_hex(const map_location& loc) {
image::get_image(fog_image, image_type)));
}
bool has_fog_shroud = fogged(loc);
if(!shrouded(loc)) {
drawing_buffer_add(LAYER_FOG_SHROUD, loc, tblit(xpos, ypos,
get_fog_shroud_images(loc, image_type)));
const std::vector<surface>& fog_shroud = get_fog_shroud_images(loc, image_type);
has_fog_shroud |= !fog_shroud.empty();
drawing_buffer_add(LAYER_FOG_SHROUD, loc, tblit(xpos, ypos, fog_shroud));
}
if(on_map && loc == mouseoverHex_) {
//when fogged we draw top part above fog (no visible unit to decapitate)
drawing_buffer_add(
has_fog_shroud ? LAYER_MOUSEOVER_BOTTOM : LAYER_MOUSEOVER_TOP,
loc, tblit(xpos, ypos, image::get_image("misc/hover-hex-top.png", image::SCALED_TO_HEX)));
drawing_buffer_add(LAYER_MOUSEOVER_BOTTOM,
loc, tblit(xpos, ypos, image::get_image("misc/hover-hex-bottom.png", image::SCALED_TO_HEX)));
}
if (on_map) {
if (draw_coordinates_) {
int off_x = xpos + hex_size()/2;

View file

@ -654,6 +654,7 @@ public:
LAYER_GRID_TOP, /**< Top half part of grid image */
LAYER_MOUSEOVER_OVERLAY, /**< Mouseover overlay used by editor*/
LAYER_FOOTSTEPS, /**< Footsteps showing path from unit to mouse */
LAYER_MOUSEOVER_TOP, /**< Top half of image following the mouse */
LAYER_UNIT_FIRST, /**< Reserve layers to be selected for WML. */
LAYER_UNIT_BG = LAYER_UNIT_FIRST+10, /**< Used for the ellipse behind the unit. */
LAYER_UNIT_DEFAULT=LAYER_UNIT_FIRST+40,/**<default layer for drawing units */
@ -677,7 +678,7 @@ public:
LAYER_ARROWS, /**< Arrows from the arrows framework. Used for planned moves display. */
LAYER_ACTIONS_NUMBERING, /**< Move numbering for the whiteboard. */
LAYER_SELECTED_HEX, /**< Image on the selected unit */
LAYER_MOUSEOVER_HEX, /**< Image following the mouse */
LAYER_MOUSEOVER_BOTTOM, /**< Bottom half of image following the mouse */
LAYER_ATTACK_INDICATOR, /**< Layer which holds the attack indicator. */
LAYER_UNIT_BAR, /**<
* Unit bars and overlays are drawn on this

View file

@ -84,15 +84,9 @@ void editor_display::draw_hex(const map_location& loc)
if (brush_locations_.find(loc) != brush_locations_.end()) {
static const image::locator brush(game_config::images::editor_brush);
drawing_buffer_add(LAYER_MOVE_INFO, loc, tblit(xpos, ypos,
drawing_buffer_add(LAYER_MOUSEOVER_OVERLAY, loc, tblit(xpos, ypos,
image::get_image(brush, image::SCALED_TO_HEX)));
}
if(loc == mouseoverHex_ && !game_config::images::mouseover.empty()) {
static const image::locator mouseover(game_config::images::mouseover);
drawing_buffer_add(LAYER_MOVE_INFO, loc, tblit(xpos, ypos,
image::get_image(mouseover, image::SCALED_TO_HEX)));
}
}
}

View file

@ -401,12 +401,6 @@ void game_display::draw_hex(const map_location& loc)
image::get_image(selected, image::SCALED_TO_HEX)));
}
if(on_map && loc == mouseoverHex_ && !game_config::images::mouseover.empty()) {
static const image::locator mouseover(game_config::images::mouseover);
drawing_buffer_add(LAYER_MOUSEOVER_HEX, loc, tblit(xpos, ypos,
image::get_image(mouseover, image::SCALED_TO_HEX)));
}
// Show def% and turn to reach infos
if(!is_shrouded && on_map) {
draw_movement_info(loc);