Commit b8f67bf7 authored by Alistair Leslie-Hughes's avatar Alistair Leslie-Hughes Committed by Alexandre Julliard

d3drm: IDirect3DRMMeshBuilder2 Get/SetQuality.

parent 3c304287
...@@ -165,6 +165,7 @@ struct d3drm_mesh_builder ...@@ -165,6 +165,7 @@ struct d3drm_mesh_builder
DWORD nb_materials; DWORD nb_materials;
struct mesh_material *materials; struct mesh_material *materials;
DWORD *material_indices; DWORD *material_indices;
D3DRMRENDERQUALITY quality;
}; };
struct mesh_group struct mesh_group
......
...@@ -670,9 +670,10 @@ static HRESULT WINAPI d3drm_mesh_builder2_SetTextureTopology(IDirect3DRMMeshBuil ...@@ -670,9 +670,10 @@ static HRESULT WINAPI d3drm_mesh_builder2_SetTextureTopology(IDirect3DRMMeshBuil
static HRESULT WINAPI d3drm_mesh_builder2_SetQuality(IDirect3DRMMeshBuilder2 *iface, static HRESULT WINAPI d3drm_mesh_builder2_SetQuality(IDirect3DRMMeshBuilder2 *iface,
D3DRMRENDERQUALITY quality) D3DRMRENDERQUALITY quality)
{ {
FIXME("iface %p, quality %#lx stub!\n", iface, quality); struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface);
TRACE("iface %p, quality %#lx\n", iface, quality);
return E_NOTIMPL; return IDirect3DRMMeshBuilder3_SetQuality(&mesh_builder->IDirect3DRMMeshBuilder3_iface, quality);
} }
static HRESULT WINAPI d3drm_mesh_builder2_SetPerspective(IDirect3DRMMeshBuilder2 *iface, BOOL enable) static HRESULT WINAPI d3drm_mesh_builder2_SetPerspective(IDirect3DRMMeshBuilder2 *iface, BOOL enable)
...@@ -815,9 +816,11 @@ static HRESULT WINAPI d3drm_mesh_builder2_CreateFace(IDirect3DRMMeshBuilder2 *if ...@@ -815,9 +816,11 @@ static HRESULT WINAPI d3drm_mesh_builder2_CreateFace(IDirect3DRMMeshBuilder2 *if
static D3DRMRENDERQUALITY WINAPI d3drm_mesh_builder2_GetQuality(IDirect3DRMMeshBuilder2 *iface) static D3DRMRENDERQUALITY WINAPI d3drm_mesh_builder2_GetQuality(IDirect3DRMMeshBuilder2 *iface)
{ {
FIXME("iface %p stub!\n", iface); struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface);
return 0; TRACE("iface %p\n", iface);
return mesh_builder->quality;
} }
static BOOL WINAPI d3drm_mesh_builder2_GetPerspective(IDirect3DRMMeshBuilder2 *iface) static BOOL WINAPI d3drm_mesh_builder2_GetPerspective(IDirect3DRMMeshBuilder2 *iface)
...@@ -1754,9 +1757,13 @@ static HRESULT WINAPI d3drm_mesh_builder3_SetTextureTopology(IDirect3DRMMeshBuil ...@@ -1754,9 +1757,13 @@ static HRESULT WINAPI d3drm_mesh_builder3_SetTextureTopology(IDirect3DRMMeshBuil
static HRESULT WINAPI d3drm_mesh_builder3_SetQuality(IDirect3DRMMeshBuilder3 *iface, static HRESULT WINAPI d3drm_mesh_builder3_SetQuality(IDirect3DRMMeshBuilder3 *iface,
D3DRMRENDERQUALITY quality) D3DRMRENDERQUALITY quality)
{ {
FIXME("iface %p, quality %#lx stub!\n", iface, quality); struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface);
return E_NOTIMPL; TRACE("iface %p, quality %#lx\n", iface, quality);
mesh_builder->quality = quality;
return S_OK;
} }
static HRESULT WINAPI d3drm_mesh_builder3_SetPerspective(IDirect3DRMMeshBuilder3 *iface, static HRESULT WINAPI d3drm_mesh_builder3_SetPerspective(IDirect3DRMMeshBuilder3 *iface,
...@@ -1904,9 +1911,11 @@ static HRESULT WINAPI d3drm_mesh_builder3_CreateFace(IDirect3DRMMeshBuilder3 *if ...@@ -1904,9 +1911,11 @@ static HRESULT WINAPI d3drm_mesh_builder3_CreateFace(IDirect3DRMMeshBuilder3 *if
static D3DRMRENDERQUALITY WINAPI d3drm_mesh_builder3_GetQuality(IDirect3DRMMeshBuilder3 *iface) static D3DRMRENDERQUALITY WINAPI d3drm_mesh_builder3_GetQuality(IDirect3DRMMeshBuilder3 *iface)
{ {
FIXME("iface %p stub!\n", iface); struct d3drm_mesh_builder *mesh_builder = impl_from_IDirect3DRMMeshBuilder3(iface);
return 0; TRACE("iface %p\n", iface);
return mesh_builder->quality;
} }
static BOOL WINAPI d3drm_mesh_builder3_GetPerspective(IDirect3DRMMeshBuilder3 *iface) static BOOL WINAPI d3drm_mesh_builder3_GetPerspective(IDirect3DRMMeshBuilder3 *iface)
...@@ -2345,6 +2354,7 @@ HRESULT d3drm_mesh_builder_create(struct d3drm_mesh_builder **mesh_builder, IDir ...@@ -2345,6 +2354,7 @@ HRESULT d3drm_mesh_builder_create(struct d3drm_mesh_builder **mesh_builder, IDir
object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &d3drm_mesh_builder3_vtbl; object->IDirect3DRMMeshBuilder3_iface.lpVtbl = &d3drm_mesh_builder3_vtbl;
object->ref = 1; object->ref = 1;
object->d3drm = d3drm; object->d3drm = d3drm;
object->quality = D3DRMRENDER_GOURAUD;
IDirect3DRM_AddRef(object->d3drm); IDirect3DRM_AddRef(object->d3drm);
d3drm_object_init(&object->obj, classname); d3drm_object_init(&object->obj, classname);
......
...@@ -863,6 +863,7 @@ static void test_Face(void) ...@@ -863,6 +863,7 @@ static void test_Face(void)
D3DCOLOR color; D3DCOLOR color;
DWORD count; DWORD count;
int icount; int icount;
D3DRMRENDERQUALITY quality;
hr = Direct3DRMCreate(&d3drm); hr = Direct3DRMCreate(&d3drm);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface, hr %#lx\n", hr); ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface, hr %#lx\n", hr);
...@@ -934,6 +935,18 @@ static void test_Face(void) ...@@ -934,6 +935,18 @@ static void test_Face(void)
icount = IDirect3DRMFace_GetVertexCount(face1); icount = IDirect3DRMFace_GetVertexCount(face1);
ok(!icount, "wrong VertexCount: %i\n", icount); ok(!icount, "wrong VertexCount: %i\n", icount);
quality = IDirect3DRMMeshBuilder3_GetQuality(MeshBuilder2);
ok(quality == D3DRMRENDER_GOURAUD, "Unexpected %lx.\n", quality);
hr = IDirect3DRMMeshBuilder3_SetQuality(MeshBuilder2, D3DRMRENDER_PHONG);
ok(hr == S_OK, "got %lx.\n", hr);
quality = IDirect3DRMMeshBuilder3_GetQuality(MeshBuilder2);
ok(quality == D3DRMRENDER_PHONG, "got %lx.\n", quality);
hr = IDirect3DRMMeshBuilder3_SetQuality(MeshBuilder2, D3DRMRENDER_GOURAUD);
ok(hr == S_OK, "got %lx.\n", hr);
IDirect3DRMFace_Release(face1); IDirect3DRMFace_Release(face1);
IDirect3DRMMeshBuilder2_Release(MeshBuilder2); IDirect3DRMMeshBuilder2_Release(MeshBuilder2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment