From e25f4e507d1a4fab63db949a02ba183f12e37fba Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Sat, 7 Jan 2017 16:51:48 -0800 Subject: [PATCH] Really fixed blit issue for capehill --- src/video/SDL_blit.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/video/SDL_blit.h b/src/video/SDL_blit.h index ad705d1fe37ce..650d7b8edb069 100644 --- a/src/video/SDL_blit.h +++ b/src/video/SDL_blit.h @@ -443,18 +443,18 @@ do { \ /* Blend the RGB values of two pixels with an alpha value */ #define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB) \ do { \ - dR = (Uint8)((((int)(sR-dR)*A)/255)+dR); \ - dG = (Uint8)((((int)(sG-dG)*A)/255)+dG); \ - dB = (Uint8)((((int)(sB-dB)*A)/255)+dB); \ + dR = (Uint8)((((int)(sR-dR)*(int)A)/255)+dR); \ + dG = (Uint8)((((int)(sG-dG)*(int)A)/255)+dG); \ + dB = (Uint8)((((int)(sB-dB)*(int)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 = (Uint8)((((int)(sR-dR)*sA)/255)+dR); \ - dG = (Uint8)((((int)(sG-dG)*sA)/255)+dG); \ - dB = (Uint8)((((int)(sB-dB)*sA)/255)+dB); \ + dR = (Uint8)((((int)(sR-dR)*(int)sA)/255)+dR); \ + dG = (Uint8)((((int)(sG-dG)*(int)sA)/255)+dG); \ + dB = (Uint8)((((int)(sB-dB)*(int)sA)/255)+dB); \ dA = (Uint8)((int)sA+dA-((int)sA*dA)/255); \ } while(0)