From 0f44081775ee4fccd63a9af0823cfbe4ebb66acd Mon Sep 17 00:00:00 2001 From: Alistair Leslie-Hughes Date: Fri, 13 May 2022 13:19:15 +1000 Subject: [PATCH] d3drm: IDirect3DRMTexture3 Get/SetShades. Signed-off-by: Alistair Leslie-Hughes Signed-off-by: Alexandre Julliard --- dlls/d3drm/d3drm_private.h | 1 + dlls/d3drm/tests/d3drm.c | 20 +++++++++++++++++++- dlls/d3drm/texture.c | 14 +++++++++----- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 9cebefb955a..44bf41fdabf 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -67,6 +67,7 @@ struct d3drm_texture LONG decal_x; LONG decal_y; DWORD max_colors; + DWORD max_shades; }; struct d3drm_frame diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 0244892cdcf..426aa1fd28d 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2707,7 +2707,7 @@ static void test_Texture(void) IDirect3DRMTexture3 *texture3; IDirectDrawSurface *surface; LONG decalx, decaly; - DWORD colors; + DWORD colors, shades; D3DRMIMAGE initimg = { @@ -2897,6 +2897,24 @@ static void test_Texture(void) hr = IDirect3DRMTexture_SetColors(texture1, 8); ok(hr == S_OK, "got %#lx.\n", hr); + shades = IDirect3DRMTexture_GetShades(texture1); + ok(shades == 16, "got %ld.\n", shades); + + hr = IDirect3DRMTexture_SetShades(texture1, 8); + ok(hr == S_OK, "got %#lx.\n", hr); + + shades = IDirect3DRMTexture_GetShades(texture1); + ok(shades == 8, "got %ld.\n", shades); + + hr = IDirect3DRMTexture_SetShades(texture1, 11); + ok(hr == S_OK, "got %#lx.\n", hr); + + shades = IDirect3DRMTexture_GetShades(texture1); + ok(shades == 11, "got %ld.\n", shades); + + hr = IDirect3DRMTexture_SetShades(texture1, 8); + ok(hr == S_OK, "got %#lx.\n", hr); + d3drm_img = IDirect3DRMTexture_GetImage(texture1); ok(!!d3drm_img, "Failed to get image.\n"); ok(d3drm_img == &initimg, "Expected image returned == %p, got %p.\n", &initimg, d3drm_img); diff --git a/dlls/d3drm/texture.c b/dlls/d3drm/texture.c index 86fc5cd1595..76f82671811 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -1183,9 +1183,12 @@ static HRESULT WINAPI d3drm_texture3_SetColors(IDirect3DRMTexture3 *iface, DWORD static HRESULT WINAPI d3drm_texture3_SetShades(IDirect3DRMTexture3 *iface, DWORD max_shades) { - FIXME("iface %p, max_shades %lu stub!\n", iface, max_shades); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + TRACE("iface %p, max_shades %lu\n", iface, max_shades); - return E_NOTIMPL; + texture->max_shades = max_shades; + + return S_OK; } static HRESULT WINAPI d3drm_texture3_SetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE width, D3DVALUE height) @@ -1258,9 +1261,9 @@ static D3DRMIMAGE * WINAPI d3drm_texture3_GetImage(IDirect3DRMTexture3 *iface) static DWORD WINAPI d3drm_texture3_GetShades(IDirect3DRMTexture3 *iface) { - FIXME("iface %p stub!\n", iface); - - return 0; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + TRACE("iface %p\n", iface); + return texture->max_shades; } static DWORD WINAPI d3drm_texture3_GetColors(IDirect3DRMTexture3 *iface) @@ -1437,6 +1440,7 @@ HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) object->IDirect3DRMTexture3_iface.lpVtbl = &d3drm_texture3_vtbl; object->d3drm = d3drm; object->max_colors = 8; + object->max_shades = 16; d3drm_object_init(&object->obj, classname);