Commit 2567bd8a authored by David Adam's avatar David Adam Committed by Alexandre Julliard

d3dx8: Implement D3DXPlaneColorAdd.

parent 0dc3208c
......@@ -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);
......
......@@ -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;
......
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