mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-06-02 07:27:19 +08:00
Fix rounding in MULT_DIV_255
This commit is contained in:
@@ -513,6 +513,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface);
|
|||||||
#define MULT_DIV_255(sC, dC, out) \
|
#define MULT_DIV_255(sC, dC, out) \
|
||||||
do { \
|
do { \
|
||||||
Uint16 x = sC * dC; \
|
Uint16 x = sC * dC; \
|
||||||
|
x += 0x1U; \
|
||||||
x += x >> 8; \
|
x += x >> 8; \
|
||||||
out = x >> 8; \
|
out = x >> 8; \
|
||||||
} while (0)
|
} while (0)
|
||||||
|
|||||||
Reference in New Issue
Block a user