Revert "disable "alpha thresholding" in our bilinear interpolation algo"
This reverts commit d73a117278
.
This is being reverted because there is still yet more bad behavior
in our alpha channel when scaling images, for instance this causes
the terrain overlays to disappear when mousing over terrains with
one of the editor terrain tools.
The reason is that our "scale image" routine is broken and doesn't
weight color contributions by alpha. It's not apporpriate to get
rid of the hacks like alpha thresholding until that has been fixed
and that can't be fixed on 1.12 right now.
This commit is contained in:
parent
b0891e6eff
commit
0d02afd672
1 changed files with 14 additions and 0 deletions
|
@ -523,6 +523,19 @@ surface scale_surface(const surface &surf, int w, int h, bool optimize)
|
|||
// Some of the input images are hex tiles,
|
||||
// created using a hexagon shaped alpha channel
|
||||
// that is either set to full-on or full-off.
|
||||
//
|
||||
// If intermediate alpha values are introduced
|
||||
// along a hex edge, it produces a gametime artifact.
|
||||
// Moving the mouse around will leave behind
|
||||
// "hexagon halos" from the temporary highlighting.
|
||||
// In other words, the Wesnoth rendering engine
|
||||
// freaks out.
|
||||
//
|
||||
// The alpha thresholding step attempts
|
||||
// to accommodates this limitation.
|
||||
// There is a small loss of quality.
|
||||
// For example, skeleton bowstrings
|
||||
// are not as good as they could be.
|
||||
|
||||
rr = gg = bb = aa = 0;
|
||||
for (loc=0; loc<4; loc++) {
|
||||
|
@ -544,6 +557,7 @@ surface scale_surface(const surface &surf, int w, int h, bool optimize)
|
|||
g = gg >> 16;
|
||||
b = bb >> 16;
|
||||
a = aa >> 16;
|
||||
a = (a < avg_a/2) ? 0 : avg_a;
|
||||
*dst_word = (a << 24) + (r << 16) + (g << 8) + b;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue