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
1 changed files with 3 additions and 4 deletions
|
@ -513,11 +513,10 @@ surface scale_surface(const surface &surf, int w, int h, bool optimize)
|
|||
}
|
||||
|
||||
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;
|
||||
red = red * factor + 0.5;
|
||||
green = green * factor + 0.5;
|
||||
blue = blue * factor + 0.5;
|
||||
}
|
||||
|
||||
dst_pixels[ydst*dst->w + xdst] = SDL_MapRGBA(
|
||||
|
|
Loading…
Add table
Reference in a new issue