mirror of
https://github.com/yawut/SDL.git
synced 2026-07-01 00:39:58 -05:00
Thank you automated tests (and bobbens!), fixed alpha blending for accuracy
This commit is contained in:
parent
0b1a37f8ba
commit
e024bcf596
|
|
@ -444,9 +444,9 @@ do { \
|
|||
/* 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 = (((sR-dR)*(A)+255)>>8)+dR; \
|
||||
dG = (((sG-dG)*(A)+255)>>8)+dG; \
|
||||
dB = (((sB-dB)*(A)+255)>>8)+dB; \
|
||||
dR = ((((int)(sR-dR)*(int)A)/255)+dR); \
|
||||
dG = ((((int)(sG-dG)*(int)A)/255)+dG); \
|
||||
dB = ((((int)(sB-dB)*(int)A)/255)+dB); \
|
||||
} while(0)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user