Commit f62ed3cb authored by Sam Lantinga's avatar Sam Lantinga

Thank you automated tests (and bobbens!), fixed alpha blending for accuracy

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%404176
parent 209448b7
...@@ -444,9 +444,9 @@ do { \ ...@@ -444,9 +444,9 @@ do { \
/* Blend the RGB values of two Pixels based on a source alpha value */ /* Blend the RGB values of two Pixels based on a source alpha value */
#define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \ #define ALPHA_BLEND(sR, sG, sB, A, dR, dG, dB) \
do { \ do { \
dR = (((sR-dR)*(A)+255)>>8)+dR; \ dR = ((((int)(sR-dR)*(int)A)/255)+dR); \
dG = (((sG-dG)*(A)+255)>>8)+dG; \ dG = ((((int)(sG-dG)*(int)A)/255)+dG); \
dB = (((sB-dB)*(A)+255)>>8)+dB; \ dB = ((((int)(sB-dB)*(int)A)/255)+dB); \
} while(0) } while(0)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment