Fix for halos glitching through locations that become shrouded after rendering

Halos are never rendered for shrouded locations, but they are still
unrendered for them. A long-standing issue with [item] halos resulting
from this is that a halo that gets rendered to the screen at least once
for an unshrouded location later causes glitches if that location is
manually shrouded afterwards.

This can be avoided by not unrendering halos for shrouded locations. I
believe this solution makes sense because halos for shrouded locations
are never rendered first, and if the location is shrouded later on, the
display code will redraw the affected locations and overlay shroud on
top, causing the halo object's unrender buffer to become hopelessly
obsolete.
This commit is contained in:
Ignacio R. Morelle 2014-03-18 23:50:34 -03:00
parent e149b3f8d2
commit eb07de2bc2
3 changed files with 17 additions and 2 deletions

View File

@ -36,6 +36,8 @@ Version 1.13.0-dev:
when the campaign is reloaded from a non-host side, or after a player rejoins
from observer status. Hopefully, reloading campaigns is easier after this.
* Fix bug #21797: "Mandatory WML child missing" when leaving a reloaded game.
* Fixed halos glitching through locations that become shrouded after the
halo is rendered for the first time.
Version 1.11.11:
* Add-ons server:

View File

@ -5,14 +5,18 @@ changelog: https://github.com/wesnoth/wesnoth/blob/master/changelog
Version 1.13.0-dev:
* Language and i18n:
* Updated translations: German, Scottish Gaelic, Slovak.
* Units:
* Increased the experience requirement for the Rami from 32 to 39.
* Increased the experience requirement for the Saree from 56 to 64.
* User interface:
* Made orb and minmap colors configurable by the game preferences.
* Miscellaneous and bug fixes:
* Fixed halos glitching through locations that become shrouded after the
halo is rendered for the first time.
Version 1.11.11:
* Campaigns:

View File

@ -215,6 +215,15 @@ void effect::unrender()
return;
}
// Shrouded haloes are never rendered unless shroud has been re-placed; in
// that case, unrendering causes the hidden terrain (and previous halo
// frame, when dealing with animated halos) to glitch through shroud. We
// don't need to unrender them because shroud paints over the underlying
// area anyway.
if (loc_.x != -1 && loc_.y != -1 && disp->shrouded(loc_)) {
return;
}
surface screen = disp->get_screen_surface();
SDL_Rect clip_rect = disp->map_outside_area();