Really fixed blit issue for capehill
authorSam Lantinga
Sat, 07 Jan 2017 16:51:48 -0800
changeset 10779bdc808b931a5
parent 10778 fe9c7d01a093
child 10780 4ea5472ed455
Really fixed blit issue for capehill
src/video/SDL_blit.h
     1.1 --- a/src/video/SDL_blit.h	Sat Jan 07 10:13:04 2017 -0800
     1.2 +++ b/src/video/SDL_blit.h	Sat Jan 07 16:51:48 2017 -0800
     1.3 @@ -443,18 +443,18 @@
     1.4  /* Blend the RGB values of two pixels with an alpha value */
     1.5  #define ALPHA_BLEND_RGB(sR, sG, sB, A, dR, dG, dB)                      \
     1.6  do {                                                                    \
     1.7 -    dR = (Uint8)((((int)(sR-dR)*A)/255)+dR);                            \
     1.8 -    dG = (Uint8)((((int)(sG-dG)*A)/255)+dG);                            \
     1.9 -    dB = (Uint8)((((int)(sB-dB)*A)/255)+dB);                            \
    1.10 +    dR = (Uint8)((((int)(sR-dR)*(int)A)/255)+dR);                       \
    1.11 +    dG = (Uint8)((((int)(sG-dG)*(int)A)/255)+dG);                       \
    1.12 +    dB = (Uint8)((((int)(sB-dB)*(int)A)/255)+dB);                       \
    1.13  } while(0)
    1.14  
    1.15  
    1.16  /* Blend the RGBA values of two pixels */
    1.17  #define ALPHA_BLEND_RGBA(sR, sG, sB, sA, dR, dG, dB, dA)                \
    1.18  do {                                                                    \
    1.19 -    dR = (Uint8)((((int)(sR-dR)*sA)/255)+dR);                           \
    1.20 -    dG = (Uint8)((((int)(sG-dG)*sA)/255)+dG);                           \
    1.21 -    dB = (Uint8)((((int)(sB-dB)*sA)/255)+dB);                           \
    1.22 +    dR = (Uint8)((((int)(sR-dR)*(int)sA)/255)+dR);                      \
    1.23 +    dG = (Uint8)((((int)(sG-dG)*(int)sA)/255)+dG);                      \
    1.24 +    dB = (Uint8)((((int)(sB-dB)*(int)sA)/255)+dB);                      \
    1.25      dA = (Uint8)((int)sA+dA-((int)sA*dA)/255);                          \
    1.26  } while(0)
    1.27