Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com
-- v3: d3drm: IDirect3DRMTexture3 Get/SetDecalSize d3drm: IDirect3DRMTexture3 Get/SetDecalTransparency
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/d3drm/d3drm_private.h | 1 + dlls/d3drm/tests/d3drm.c | 13 +++++++++++++ dlls/d3drm/texture.c | 15 ++++++++++----- 3 files changed, 24 insertions(+), 5 deletions(-)
diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 44bf41fdabf..c5df376a72e 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -68,6 +68,7 @@ struct d3drm_texture LONG decal_y; DWORD max_colors; DWORD max_shades; + BOOL transparency; };
struct d3drm_frame diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 72c71ebae09..5e239fa93d5 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2712,6 +2712,7 @@ static void test_Texture(void) IDirectDrawSurface *surface; LONG decalx, decaly; DWORD colors, shades; + BOOL transparency;
D3DRMIMAGE initimg = { @@ -2919,6 +2920,18 @@ static void test_Texture(void) hr = IDirect3DRMTexture_SetShades(texture1, 8); ok(hr == S_OK, "got %#lx.\n", hr);
+ transparency = IDirect3DRMTexture_GetDecalTransparency(texture1); + ok(transparency == FALSE, "got %ld.\n", shades); + + hr = IDirect3DRMTexture_SetDecalTransparency(texture1, TRUE); + ok(hr == S_OK, "got %#lx.\n", hr); + + transparency = IDirect3DRMTexture_GetDecalTransparency(texture1); + ok(transparency == TRUE, "got %ld.\n", shades); + + hr = IDirect3DRMTexture_SetDecalTransparency(texture1, FALSE); + 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 76f82671811..4bb6debbde3 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -1219,9 +1219,13 @@ static HRESULT WINAPI d3drm_texture3_SetDecalScale(IDirect3DRMTexture3 *iface, D
static HRESULT WINAPI d3drm_texture3_SetDecalTransparency(IDirect3DRMTexture3 *iface, BOOL transparency) { - FIXME("iface %p, transparency %#x stub!\n", iface, transparency); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
- return E_NOTIMPL; + TRACE("iface %p, transparency %#x\n", iface, transparency); + + texture->transparency = transparency; + + return S_OK; }
static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor(IDirect3DRMTexture3 *iface, D3DCOLOR color) @@ -1282,9 +1286,9 @@ static DWORD WINAPI d3drm_texture3_GetDecalScale(IDirect3DRMTexture3 *iface)
static BOOL WINAPI d3drm_texture3_GetDecalTransparency(IDirect3DRMTexture3 *iface) { - FIXME("iface %p stub!\n", iface); - - return FALSE; + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + TRACE("iface %p\n", iface); + return texture->transparency; }
static D3DCOLOR WINAPI d3drm_texture3_GetDecalTransparentColor(IDirect3DRMTexture3 *iface) @@ -1441,6 +1445,7 @@ HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) object->d3drm = d3drm; object->max_colors = 8; object->max_shades = 16; + object->transparency = FALSE;
d3drm_object_init(&object->obj, classname);
From: Alistair Leslie-Hughes leslie_alistair@hotmail.com
Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/d3drm/d3drm_private.h | 2 ++ dlls/d3drm/tests/d3drm.c | 41 ++++++++++++++++++++++++++++++++++++++ dlls/d3drm/texture.c | 19 ++++++++++++++---- 3 files changed, 58 insertions(+), 4 deletions(-)
diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index c5df376a72e..2fb6bafe951 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -69,6 +69,8 @@ struct d3drm_texture DWORD max_colors; DWORD max_shades; BOOL transparency; + D3DVALUE decal_width; + D3DVALUE decal_height; };
struct d3drm_frame diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 5e239fa93d5..3f4571553e6 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2713,6 +2713,7 @@ static void test_Texture(void) LONG decalx, decaly; DWORD colors, shades; BOOL transparency; + D3DVALUE width, height;
D3DRMIMAGE initimg = { @@ -2920,6 +2921,46 @@ static void test_Texture(void) hr = IDirect3DRMTexture_SetShades(texture1, 8); ok(hr == S_OK, "got %#lx.\n", hr);
+ hr = IDirect3DRMTexture_GetDecalSize(texture1, &width, &height); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(width == 1.0, "got %.8e.\n", width); + ok(height == 1.0, "got %.8e.\n", height); + + hr = IDirect3DRMTexture_SetDecalSize(texture1, -1.0, 7.0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = IDirect3DRMTexture_GetDecalSize(texture1, &width, &height); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(width == -1.0, "got %.8e.\n", width); + ok(height == 7.0, "got %.8e.\n", height); + + hr = IDirect3DRMTexture_SetDecalSize(texture1, 1.0, -2.0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = IDirect3DRMTexture_GetDecalSize(texture1, &width, &height); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(width == 1.0, "got %.8e.\n", width); + ok(height == -2.0, "got %.8e.\n", height); + + hr = IDirect3DRMTexture_SetDecalSize(texture1, -1.0, -2.0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = IDirect3DRMTexture_GetDecalSize(texture1, &width, &height); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(width == -1.0, "got %.8e.\n", width); + ok(height == -2.0, "got %.8e.\n", height); + + hr = IDirect3DRMTexture_SetDecalSize(texture1, 8.0, 7.0); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = IDirect3DRMTexture_GetDecalSize(texture1, &width, &height); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(width == 8.0, "got %.8e.\n", width); + ok(height == 7.0, "got %.8e.\n", height); + + hr = IDirect3DRMTexture_SetDecalSize(texture1, 1.0, 1.0); + ok(hr == S_OK, "got %#lx.\n", hr); + transparency = IDirect3DRMTexture_GetDecalTransparency(texture1); ok(transparency == FALSE, "got %ld.\n", shades);
diff --git a/dlls/d3drm/texture.c b/dlls/d3drm/texture.c index 4bb6debbde3..02d8a2438a5 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -1193,9 +1193,13 @@ static HRESULT WINAPI d3drm_texture3_SetShades(IDirect3DRMTexture3 *iface, DWORD
static HRESULT WINAPI d3drm_texture3_SetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE width, D3DVALUE height) { - FIXME("iface %p, width %.8e, height %.8e stub!\n", iface, width, height); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface); + TRACE("iface %p, width %.8e, height %.8e\n", iface, width, height);
- return E_NOTIMPL; + texture->decal_width = width; + texture->decal_height = height; + + return S_OK; }
static HRESULT WINAPI d3drm_texture3_SetDecalOrigin(IDirect3DRMTexture3 *iface, LONG x, LONG y) @@ -1237,9 +1241,14 @@ static HRESULT WINAPI d3drm_texture3_SetDecalTransparentColor(IDirect3DRMTexture
static HRESULT WINAPI d3drm_texture3_GetDecalSize(IDirect3DRMTexture3 *iface, D3DVALUE *width, D3DVALUE *height) { - FIXME("iface %p, width %p, height %p stub!\n", iface, width, height); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
- return E_NOTIMPL; + TRACE("iface %p, width %p, height %p\n", iface, width, height); + + *width = texture->decal_width; + *height = texture->decal_height; + + return S_OK; }
static HRESULT WINAPI d3drm_texture3_GetDecalOrigin(IDirect3DRMTexture3 *iface, LONG *x, LONG *y) @@ -1446,6 +1455,8 @@ HRESULT d3drm_texture_create(struct d3drm_texture **texture, IDirect3DRM *d3drm) object->max_colors = 8; object->max_shades = 16; object->transparency = FALSE; + object->decal_width = 1.0; + object->decal_height = 1.0;
d3drm_object_init(&object->obj, classname);
This merge request was closed by Alistair Leslie-Hughes.