Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unsigned int interpolate_colors(unsigned int c1, unsigned int c2, unsigned int alpha) {
- unsigned int r;
- __asm {
- pxor mm7,mm7
- movd mm0,c1
- movd mm1,c2
- mov eax,alpha
- shl eax,16
- add eax,alpha
- movd mm3,eax
- movq mm2,mm3
- punpckldq mm3,mm2
- punpcklbw mm0,mm7
- punpcklbw mm1,mm7
- psubw mm1,mm0
- pmullw mm1,mm3
- psrlw mm1,8
- paddb mm1,mm0
- packuswb mm1,mm7
- movd r,mm1
- emms;
- }
- return r;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement