Selaa lähdekoodia

Fix rounding in MULT_DIV_255

Brick 1 vuosi sitten
vanhempi
commit
5d875aa94e
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      src/video/SDL_blit.h

+ 1 - 0
src/video/SDL_blit.h

@@ -513,6 +513,7 @@ extern SDL_BlitFunc SDL_CalculateBlitA(SDL_Surface *surface);
 #define MULT_DIV_255(sC, dC, out) \
     do {                          \
         Uint16 x = sC * dC;       \
+        x += 0x1U;                \
         x += x >> 8;              \
         out = x >> 8;             \
     } while (0)