mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-17 11:21:39 +00:00
fix the position of some halos when unit has a height offset (patch #710)
This commit is contained in:
parent
a97bae57d8
commit
0b07431b1a
@ -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:
|
||||||
|
@ -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
|
||||||
|
27
src/unit.cpp
27
src/unit.cpp
@ -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,
|
||||||
halo::HREVERSE);
|
current_frame.halo(ft), gamemap::location(-1, -1),
|
||||||
} else {
|
halo::HREVERSE);
|
||||||
const int d = disp.hex_size() / 2;
|
else
|
||||||
unit_anim_halo_ = halo::add(x+d+static_cast<int>(current_frame.halo_x(anim_->get_current_frame_time())*disp.zoom()),
|
unit_anim_halo_ = halo::add(x + d + dx, hy,
|
||||||
y+d+static_cast<int>(current_frame.halo_y(anim_->get_current_frame_time())*disp.zoom()),
|
current_frame.halo(ft), gamemap::location(-1, -1));
|
||||||
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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user