# HG changeset patch # User Ryan C. Gordon # Date 1263104319 0 # Node ID 83910f4c373fe403b66e30dab9afa72c718c190c # Parent 9b1af1049f66d98d1c0850bdb2165aeb1c07a14b Merged r4992:4993 from branches/SDL-1.2: increased alpha blend accuracy. diff -r 9b1af1049f66 -r 83910f4c373f src/video/SDL_blit.h --- a/src/video/SDL_blit.h Sun Jan 10 05:39:46 2010 +0000 +++ b/src/video/SDL_blit.h Sun Jan 10 06:18:39 2010 +0000 @@ -444,9 +444,9 @@ /* Blend the RGB values of two Pixels based on a source alpha value */ #define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \ do { \ - dR = ((((int)(sR-dR)*(int)A)/255)+dR); \ - dG = ((((int)(sG-dG)*(int)A)/255)+dG); \ - dB = ((((int)(sB-dB)*(int)A)/255)+dB); \ + dR = (((((int)(sR-dR)*((int)A))+255)/255)+dR); \ + dG = (((((int)(sG-dG)*((int)A))+255)/255)+dG); \ + dB = (((((int)(sB-dB)*((int)A))+255)/255)+dB); \ } while(0)