diff -r 220a81177cfb -r 6285a56f6729 src/video/SDL_blit.h --- a/src/video/SDL_blit.h Thu Jan 05 02:53:29 2017 -0800 +++ b/src/video/SDL_blit.h Thu Jan 05 08:16:39 2017 -0800 @@ -443,19 +443,19 @@ /* Blend the RGB values of two pixels with an alpha value */ #define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ do { \ - dR = ((((unsigned)(sR-dR)*(unsigned)A)/255)+dR); \ - dG = ((((unsigned)(sG-dG)*(unsigned)A)/255)+dG); \ - dB = ((((unsigned)(sB-dB)*(unsigned)A)/255)+dB); \ + dR = (Uint8)((((int)(sR-dR)*A)/255)+dR); \ + dG = (Uint8)((((int)(sG-dG)*A)/255)+dG); \ + dB = (Uint8)((((int)(sB-dB)*A)/255)+dB); \ } while(0) /* Blend the RGBA values of two pixels */ #define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA) \ do { \ - dR = ((((unsigned)(sR-dR)*(unsigned)sA)/255)+dR); \ - dG = ((((unsigned)(sG-dG)*(unsigned)sA)/255)+dG); \ - dB = ((((unsigned)(sB-dB)*(unsigned)sA)/255)+dB); \ - dA = ((unsigned)sA+(unsigned)dA-((unsigned)sA*dA)/255); \ + dR = (Uint8)((((int)(sR-dR)*sA)/255)+dR); \ + dG = (Uint8)((((int)(sG-dG)*sA)/255)+dG); \ + dB = (Uint8)((((int)(sB-dB)*sA)/255)+dB); \ + dA = (Uint8)((int)sA+dA-((int)sA*dA)/255); \ } while(0)