d3dx8: Implement D3DXPlaneColorSubtract.

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

View File

@ -108,6 +108,18 @@ static void D3DXColorTest(void)
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
funcpointer = D3DXColorScale(NULL,NULL,scale);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
/*_______________D3DXColorSubtract_______________*/
expected.r = -0.1f; expected.g = 0.25f; expected.b = -0.35f, expected.a = 0.82f;
D3DXColorSubtract(&got,&color,&color2);
expect_color(expected,got);
/* Test the NULL case */
funcpointer = D3DXColorSubtract(&got,NULL,&color2);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
funcpointer = D3DXColorSubtract(NULL,NULL,&color2);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
funcpointer = D3DXColorSubtract(NULL,NULL,NULL);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
}
static void D3DXPlaneTest(void)

View File

@ -71,6 +71,16 @@ static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FL
return pout;
}
static inline D3DXCOLOR* D3DXColorSubtract(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;
}
/*_______________D3DXVECTOR2________________________*/
static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)