d3dx8: Implement D3DXPlaneColorScale.

This commit is contained in:
David Adam 2007-10-23 13:06:51 +02:00 committed by Alexandre Julliard
parent 03e92443d7
commit 0dc3208cf6
2 changed files with 20 additions and 0 deletions

View File

@ -86,6 +86,16 @@ static void D3DXColorTest(void)
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
funcpointer = D3DXColorNegative(NULL,NULL);
ok(funcpointer == NULL, "Expected: %p, Got: %p\n", NULL, funcpointer);
/*_______________D3DXColorScale________________*/
expected.r = 0.06f; expected.g = 0.225f; expected.b = 0.123f; expected.a = 0.279f;
D3DXColorScale(&got,&color,scale);
expect_color(expected,got);
/* Test the NULL case */
funcpointer = D3DXColorScale(&got,NULL,scale);
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);
}
static void D3DXPlaneTest(void)

View File

@ -51,6 +51,16 @@ static inline D3DXCOLOR* D3DXColorNegative(D3DXCOLOR *pout, CONST D3DXCOLOR *pc)
return pout;
}
static inline D3DXCOLOR* D3DXColorScale(D3DXCOLOR *pout, CONST D3DXCOLOR *pc, FLOAT s)
{
if ( !pout || !pc ) return NULL;
pout->r = s* (pc->r);
pout->g = s* (pc->g);
pout->b = s* (pc->b);
pout->a = s* (pc->a);
return pout;
}
/*_______________D3DXVECTOR2________________________*/
static inline D3DXVECTOR2* D3DXVec2Add(D3DXVECTOR2 *pout, CONST D3DXVECTOR2 *pv1, CONST D3DXVECTOR2 *pv2)