d3dx8: Implement D3DXPlaneColorAdd.

This commit is contained in:
David Adam 2007-10-23 13:14:19 +02:00 committed by Alexandre Julliard
parent 0dc3208cf6
commit 2567bd8a98
2 changed files with 22 additions and 0 deletions

View File

@ -43,6 +43,18 @@ static void D3DXColorTest(void)
color2.r = 0.3f; color2.g = 0.5f; color2.b = 0.76f; color2.a = 0.11f;
scale = 0.3f;
/*_______________D3DXColorAdd________________*/
expected.r = 0.9f; expected.g = 1.05f; expected.b = 0.99f, expected.a = 0.93f;
D3DXColorAdd(&got,&color1,&color2);
expect_color(expected,got);
/* Test the NULL case */
funcpointer = D3DXColorAdd(&got,NULL,&color2);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
funcpointer = D3DXColorAdd(NULL,NULL,&color2);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
funcpointer = D3DXColorAdd(NULL,NULL,NULL);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
/*_______________D3DXColorLerp________________*/
expected.r = 0.32f; expected.g = 0.69f; expected.b = 0.356f; expected.a = 0.897f;
D3DXColorLerp(&got,&color,&color1,scale);

View File

@ -21,6 +21,16 @@
/*_______________D3DXCOLOR_____________________*/
static inline D3DXCOLOR* D3DXColorAdd(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2)
{
if ( !pout || !pc1 || !pc2 ) return NULL;
pout->r = (pc1->r) + (pc2->r);
pout->g = (pc1->g) + (pc2->g);
pout->b = (pc1->b) + (pc2->b);
pout->a = (pc1->a) + (pc2->a);
return pout;
}
static inline D3DXCOLOR* D3DXColorLerp(D3DXCOLOR *pout, CONST D3DXCOLOR *pc1, CONST D3DXCOLOR *pc2, FLOAT s)
{
if ( !pout || !pc1 || !pc2 ) return NULL;