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 glitches when scrolling the map if zoomed out (bug #8768)
* fix the right border glitch of the map when zooming (bug #6060 and others) * 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) * 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 * scenery
* added animated windmill, fancy and damaged tents, icepack, and shipwreck * added animated windmill, fancy and damaged tents, icepack, and shipwreck
* language and i18n: * language and i18n:

View File

@ -29,6 +29,7 @@ Version 1.3.1+svn:
as intended). as intended).
* Fix some glitches when scrolling or zooming the map. * Fix some glitches when scrolling or zooming the map.
* Flying units are no longer buried in a castle. * 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: * Units changes and balancing:
* Converted the cold resistance of the Elvish Sorceress line to a holy * 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; unit_anim_halo_ = halo::NO_HALO;
} }
if(!current_frame.halo(anim_->get_current_frame_time()).empty()) { if(!current_frame.halo(anim_->get_current_frame_time()).empty()) {
int d = disp.hex_size() / 2;
if(facing_ == gamemap::location::NORTH_WEST || facing_ == gamemap::location::SOUTH_WEST) { int ft = anim_->get_current_frame_time();
const int d = disp.hex_size() / 2; int dx = int(current_frame.halo_x(ft) * disp.zoom());
unit_anim_halo_ = halo::add(x+d-static_cast<int>(current_frame.halo_x(anim_->get_current_frame_time())*disp.zoom()), int hy = y + d - height_adjust + int(current_frame.halo_y(ft) * disp.zoom());
y+d+static_cast<int>(current_frame.halo_y(anim_->get_current_frame_time())*disp.zoom()), if (facing_ == gamemap::location::NORTH_WEST ||
current_frame.halo(anim_->get_current_frame_time()), facing_ == gamemap::location::SOUTH_WEST)
gamemap::location(-1, -1), unit_anim_halo_ = halo::add(x + d - dx, hy,
current_frame.halo(ft), gamemap::location(-1, -1),
halo::HREVERSE); halo::HREVERSE);
} else { else
const int d = disp.hex_size() / 2; unit_anim_halo_ = halo::add(x + d + dx, hy,
unit_anim_halo_ = halo::add(x+d+static_cast<int>(current_frame.halo_x(anim_->get_current_frame_time())*disp.zoom()), current_frame.halo(ft), gamemap::location(-1, -1));
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));
}
} }
image::locator loc; image::locator loc;
loc = current_frame.image(); loc = current_frame.image();