mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-04 11:43:32 +00:00
Slightly rework the scale algorithm.
This doesn't change the output for the double floating point emulation, but improves the output for the Sint32 version.
This commit is contained in:
parent
2f52d77416
commit
e8925c8487
@ -513,11 +513,10 @@ surface scale_surface(const surface &surf, int w, int h, bool optimize)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (alpha != 0) {
|
if (alpha != 0) {
|
||||||
tfloat factor = 1 / alpha;
|
red = red / alpha + 0.5;
|
||||||
|
green = green / alpha + 0.5;
|
||||||
|
blue = blue / alpha + 0.5;
|
||||||
alpha = alpha / summation + 0.5;
|
alpha = alpha / summation + 0.5;
|
||||||
red = red * factor + 0.5;
|
|
||||||
green = green * factor + 0.5;
|
|
||||||
blue = blue * factor + 0.5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dst_pixels[ydst*dst->w + xdst] = SDL_MapRGBA(
|
dst_pixels[ydst*dst->w + xdst] = SDL_MapRGBA(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user