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 | 17 +++++++++++++++++ dlls/d3drm/texture.c | 18 ++++++++++++++---- 3 files changed, 33 insertions(+), 4 deletions(-)
diff --git a/dlls/d3drm/d3drm_private.h b/dlls/d3drm/d3drm_private.h index 4aea42ce0a3..26accb1e1fb 100644 --- a/dlls/d3drm/d3drm_private.h +++ b/dlls/d3drm/d3drm_private.h @@ -64,6 +64,8 @@ struct d3drm_texture IDirect3DRM *d3drm; D3DRMIMAGE *image; IDirectDrawSurface *surface; + LONG decal_x; + LONG decal_y; };
struct d3drm_frame diff --git a/dlls/d3drm/tests/d3drm.c b/dlls/d3drm/tests/d3drm.c index 209ff7ec311..82993e050d5 100644 --- a/dlls/d3drm/tests/d3drm.c +++ b/dlls/d3drm/tests/d3drm.c @@ -2706,6 +2706,7 @@ static void test_Texture(void) IDirect3DRMTexture2 *texture2; IDirect3DRMTexture3 *texture3; IDirectDrawSurface *surface; + LONG decalx, decaly;
D3DRMIMAGE initimg = { @@ -2867,6 +2868,22 @@ static void test_Texture(void) test_object_name((IDirect3DRMObject *)texture2); test_object_name((IDirect3DRMObject *)texture3);
+ hr = IDirect3DRMTexture_GetDecalOrigin(texture1, &decalx, &decaly); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(decalx == 0, "got %ld.\n", decalx); + ok(decaly == 0, "got %ld.\n", decaly); + + hr = IDirect3DRMTexture_SetDecalOrigin(texture1, 1, 1); + ok(hr == S_OK, "got %#lx.\n", hr); + + hr = IDirect3DRMTexture_GetDecalOrigin(texture1, &decalx, &decaly); + ok(hr == S_OK, "got %#lx.\n", hr); + ok(decalx == 1, "got %ld.\n", decalx); + ok(decaly == 1, "got %ld.\n", decaly); + + hr = IDirect3DRMTexture_SetDecalOrigin(texture1, 0, 0); + 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 c679100c6b7..5e9dc37b3a6 100644 --- a/dlls/d3drm/texture.c +++ b/dlls/d3drm/texture.c @@ -1194,9 +1194,14 @@ static HRESULT WINAPI d3drm_texture3_SetDecalSize(IDirect3DRMTexture3 *iface, D3
static HRESULT WINAPI d3drm_texture3_SetDecalOrigin(IDirect3DRMTexture3 *iface, LONG x, LONG y) { - FIXME("iface %p, x %ld, y %ld stub!\n", iface, x, y); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
- return E_NOTIMPL; + TRACE("iface %p, x %ld, y %ld\n", iface, x, y); + + texture->decal_x = x; + texture->decal_y = y; + + return S_OK; }
static HRESULT WINAPI d3drm_texture3_SetDecalScale(IDirect3DRMTexture3 *iface, DWORD scale) @@ -1229,9 +1234,14 @@ static HRESULT WINAPI d3drm_texture3_GetDecalSize(IDirect3DRMTexture3 *iface, D3
static HRESULT WINAPI d3drm_texture3_GetDecalOrigin(IDirect3DRMTexture3 *iface, LONG *x, LONG *y) { - FIXME("iface %p, x %p, y %p stub!\n", iface, x, y); + struct d3drm_texture *texture = impl_from_IDirect3DRMTexture3(iface);
- return E_NOTIMPL; + TRACE("iface %p, x %p, y %p\n", iface, x, y); + + *x = texture->decal_x; + *y = texture->decal_y; + + return S_OK; }
static D3DRMIMAGE * WINAPI d3drm_texture3_GetImage(IDirect3DRMTexture3 *iface)