fix the position of some halos when unit has a height offset (patch #710)

This commit is contained in:
Mark de Wever 2007-03-30 17:44:37 +00:00
parent a97bae57d8
commit 0b07431b1a
3 changed files with 14 additions and 15 deletions

View File

@ -34,6 +34,7 @@ Version 1.3.1+svn:
* fix glitches when scrolling the map if zoomed out (bug #8768)
* fix the right border glitch of the map when zooming (bug #6060 and others)
* flying units are no longer buried in a castle (patch #709)
* fix the position of some halos when unit has a height offset (patch #710)
* scenery
* added animated windmill, fancy and damaged tents, icepack, and shipwreck
* language and i18n:

View File

@ -29,6 +29,7 @@ Version 1.3.1+svn:
as intended).
* Fix some glitches when scrolling or zooming the map.
* Flying units are no longer buried in a castle.
* Fixed the position of some halos when a unit was in a keep or castle.
* Units changes and balancing:
* Converted the cold resistance of the Elvish Sorceress line to a holy

View File

@ -1793,21 +1793,18 @@ void unit::redraw_unit(display& disp,gamemap::location hex)
unit_anim_halo_ = halo::NO_HALO;
}
if(!current_frame.halo(anim_->get_current_frame_time()).empty()) {
if(facing_ == gamemap::location::NORTH_WEST || facing_ == gamemap::location::SOUTH_WEST) {
const int d = disp.hex_size() / 2;
unit_anim_halo_ = halo::add(x+d-static_cast<int>(current_frame.halo_x(anim_->get_current_frame_time())*disp.zoom()),
y+d+static_cast<int>(current_frame.halo_y(anim_->get_current_frame_time())*disp.zoom()),
current_frame.halo(anim_->get_current_frame_time()),
gamemap::location(-1, -1),
halo::HREVERSE);
} else {
const int d = disp.hex_size() / 2;
unit_anim_halo_ = halo::add(x+d+static_cast<int>(current_frame.halo_x(anim_->get_current_frame_time())*disp.zoom()),
y+d+static_cast<int>(current_frame.halo_y(anim_->get_current_frame_time())*disp.zoom()),
current_frame.halo(anim_->get_current_frame_time()),
gamemap::location(-1, -1));
}
int d = disp.hex_size() / 2;
int ft = anim_->get_current_frame_time();
int dx = int(current_frame.halo_x(ft) * disp.zoom());
int hy = y + d - height_adjust + int(current_frame.halo_y(ft) * disp.zoom());
if (facing_ == gamemap::location::NORTH_WEST ||
facing_ == gamemap::location::SOUTH_WEST)
unit_anim_halo_ = halo::add(x + d - dx, hy,
current_frame.halo(ft), gamemap::location(-1, -1),
halo::HREVERSE);
else
unit_anim_halo_ = halo::add(x + d + dx, hy,
current_frame.halo(ft), gamemap::location(-1, -1));
}
image::locator loc;
loc = current_frame.image();