diff --git a/dlls/d3drm/d3drm.spec b/dlls/d3drm/d3drm.spec index 1c937b00446..e98aae89fed 100644 --- a/dlls/d3drm/d3drm.spec +++ b/dlls/d3drm/d3drm.spec @@ -1,6 +1,6 @@ @ stub D3DRMColorGetAlpha @ stub D3DRMColorGetBlue -@ stub D3DRMColorGetGreen +@ stdcall D3DRMColorGetGreen(long) @ stdcall D3DRMColorGetRed(long) @ stub D3DRMCreateColorRGB @ stub D3DRMCreateColorRGBA diff --git a/dlls/d3drm/math.c b/dlls/d3drm/math.c index 7153eaaebe5..786f6c16d42 100644 --- a/dlls/d3drm/math.c +++ b/dlls/d3drm/math.c @@ -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) { diff --git a/dlls/d3drm/tests/vector.c b/dlls/d3drm/tests/vector.c index 582c993206c..a5f073e3a90 100644 --- a/dlls/d3drm/tests/vector.c +++ b/dlls/d3drm/tests/vector.c @@ -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)