Fixed a glitch where an item halo shifted position when zooming,

which was discoverd by zookeeper. Also added a testcase in the
testscenario.
This commit is contained in:
Mark de Wever 2007-09-29 18:54:05 +00:00
parent 59735636ae
commit 00a6fb0317
3 changed files with 22 additions and 2 deletions

View file

@ -32,6 +32,9 @@ Version 1.3.8+svn:
* units:
* balancing changes:
* created undead variations for the 'bat' and 'gryphon' race
* miscellaneous and bug fixes:
* various bug fixes and code cleanups
* fixed a glitch where an item halo shifted position when zooming
Version 1.3.8:
* campaigns:

View file

@ -152,6 +152,11 @@ Xu , Qxu , Qxu , Ql , Ql , Ql
text="Northerners unleashed!"
[/label]
[item]
x,y=10,10
halo=scenery/fire1.png
[/item]
[event]
name=moveto
first_time_only=no

View file

@ -126,8 +126,20 @@ bool effect::render()
return false;
}
if(loc_.x != -1 && loc_.y != -1 && disp->shrouded(loc_)) {
return false;
if(loc_.x != -1 && loc_.y != -1) {
if(disp->shrouded(loc_)) {
return false;
} else {
// The location of a halo is an x,y value and not a map location.
// This means when a map is zoomed the halo's won't move, this glitch
// is most visible on [item] haloes. This workaround always
// recalculates the location of the halo (item haloes have a location
// parameter to hide them under the shroud) and reapplies that location.
// It might be optimized by storing and comparing the zoom value.
set_location(
disp->get_location_x(loc_) + disp->hex_size() / 2,
disp->get_location_y(loc_) + disp->hex_size() / 2);
}
}
images_.update_last_draw_time();