d3drm: Implement D3DRMColorGetGreen.

This commit is contained in:
David Adam 2007-05-20 12:25:17 +02:00 committed by Alexandre Julliard
parent e1d3e65381
commit fba5b11bea
4 changed files with 16 additions and 1 deletions

View File

@ -1,6 +1,6 @@
@ stub D3DRMColorGetAlpha
@ stub D3DRMColorGetBlue
@ stub D3DRMColorGetGreen
@ stdcall D3DRMColorGetGreen(long)
@ stdcall D3DRMColorGetRed(long)
@ stub D3DRMCreateColorRGB
@ stub D3DRMCreateColorRGBA

View File

@ -34,6 +34,12 @@
WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
/* Determine the green part of a color */
D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR color)
{
return (RGBA_GETGREEN(color)/255.0);
}
/* Determine the red part of a color */
D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR color)
{

View File

@ -79,6 +79,7 @@ static LPD3DVECTOR (WINAPI * pD3DRMVectorScale)(LPD3DVECTOR, LPD3DVECTOR, D3DVAL
static LPD3DVECTOR (WINAPI * pD3DRMVectorSubtract)(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
static LPD3DRMQUATERNION (WINAPI * pD3DRMQuaternionFromRotation)(LPD3DRMQUATERNION, LPD3DVECTOR, D3DVALUE);
static LPD3DRMQUATERNION (WINAPI * pD3DRMQuaternionSlerp)(LPD3DRMQUATERNION, LPD3DRMQUATERNION, LPD3DRMQUATERNION, D3DVALUE);
static D3DVALUE (WINAPI * pD3DRMColorGetGreen)(D3DCOLOR);
static D3DVALUE (WINAPI * pD3DRMColorGetRed)(D3DCOLOR);
#define D3DRM_GET_PROC(func) \
@ -111,6 +112,7 @@ static BOOL InitFunctionPtrs(void)
D3DRM_GET_PROC(D3DRMVectorSubtract)
D3DRM_GET_PROC(D3DRMQuaternionFromRotation)
D3DRM_GET_PROC(D3DRMQuaternionSlerp)
D3DRM_GET_PROC(D3DRMColorGetGreen)
D3DRM_GET_PROC(D3DRMColorGetRed)
return TRUE;
@ -253,6 +255,12 @@ static void ColorTest(void)
D3DCOLOR color;
D3DVALUE expected, got;
/*___________D3DRMColorGetGreen_________________________*/
color=0xad971203;
expected=6.0/85.0;
got=pD3DRMColorGetGreen(color);
ok((fabs(expected-got)<admit_error),"Expected=%f, Got=%f\n",expected,got);
/*___________D3DRMColorGetRed__________________________*/
color=0xb62d7a1c;
expected=3.0/17.0;

View File

@ -54,6 +54,7 @@ LPD3DVECTOR WINAPI D3DRMVectorReflect(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
LPD3DVECTOR WINAPI D3DRMVectorScale(LPD3DVECTOR, LPD3DVECTOR, D3DVALUE);
LPD3DVECTOR WINAPI D3DRMVectorSubtract(LPD3DVECTOR, LPD3DVECTOR, LPD3DVECTOR);
D3DVALUE WINAPI D3DRMColorGetGreen(D3DCOLOR);
D3DVALUE WINAPI D3DRMColorGetRed(D3DCOLOR);
#if defined(__cplusplus)