d3drm: IDirect3DRMTexture3 Get/SetShades.

Signed-off-by: Alistair Leslie-Hughes <leslie_alistair@hotmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alistair Leslie-Hughes 2022-05-13 13:19:15 +10:00 committed by Alexandre Julliard
parent 90b2a8e11e
commit 0f44081775
3 changed files with 29 additions and 6 deletions

View File

@ -67,6 +67,7 @@ struct d3drm_texture
LONG decal_x;
LONG decal_y;
DWORD max_colors;
DWORD max_shades;
};
struct d3drm_frame

View File

@ -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);

View File

@ -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);