d3drm: Avoid LPDIRECT3DRMMESH.

This commit is contained in:
Henri Verbeet 2013-04-22 15:18:46 +02:00 committed by Alexandre Julliard
parent c179bee494
commit cbf3ade4b9
5 changed files with 38 additions and 48 deletions

View File

@ -145,13 +145,13 @@ static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM *iface,
return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown *)parent_frame, (IUnknown **)frame);
}
static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM *iface, IDirect3DRMMesh **mesh)
{
IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, ppMesh);
TRACE("iface %p, mesh %p.\n", iface, mesh);
return IDirect3DRM3_CreateMesh(&This->IDirect3DRM3_iface, ppMesh);
return IDirect3DRM3_CreateMesh(&d3drm->IDirect3DRM3_iface, mesh);
}
static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
@ -526,13 +526,13 @@ static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2 *iface,
return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame);
}
static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh)
static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2 *iface, IDirect3DRMMesh **mesh)
{
IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM2(iface);
TRACE("(%p/%p)->(%p)\n", iface, This, ppMesh);
TRACE("iface %p, mesh %p.\n", iface, mesh);
return IDirect3DRM3_CreateMesh(&This->IDirect3DRM3_iface, ppMesh);
return IDirect3DRM3_CreateMesh(&d3drm->IDirect3DRM3_iface, mesh);
}
static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2* iface,
@ -927,13 +927,11 @@ static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3 *iface,
return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown *)parent, (IUnknown **)frame);
}
static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3* iface, LPDIRECT3DRMMESH* Mesh)
static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3 *iface, IDirect3DRMMesh **mesh)
{
IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
TRACE("iface %p, mesh %p.\n", iface, mesh);
TRACE("(%p/%p)->(%p)\n", iface, This, Mesh);
return Direct3DRMMesh_create(Mesh);
return Direct3DRMMesh_create(mesh);
}
static HRESULT WINAPI IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3* iface,

View File

@ -583,12 +583,9 @@ static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilder2Impl_GetColorSource(IDirec
return E_NOTIMPL;
}
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddMesh(IDirect3DRMMeshBuilder2* iface,
LPDIRECT3DRMMESH pMesh)
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_AddMesh(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMMesh *mesh)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
FIXME("(%p)->(%p): stub\n", This, pMesh);
FIXME("iface %p, mesh %p stub!\n", iface, mesh);
return E_NOTIMPL;
}
@ -910,14 +907,13 @@ static D3DCOLOR WINAPI IDirect3DRMMeshBuilder2Impl_GetVertexColor(IDirect3DRMMes
return 0;
}
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_CreateMesh(IDirect3DRMMeshBuilder2* iface,
LPDIRECT3DRMMESH* mesh)
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_CreateMesh(IDirect3DRMMeshBuilder2 *iface, IDirect3DRMMesh **mesh)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
IDirect3DRMMeshBuilderImpl *mesh_builder = impl_from_IDirect3DRMMeshBuilder2(iface);
TRACE("(%p)->(%p)\n", This, mesh);
TRACE("iface %p, mesh %p.\n", iface, mesh);
return IDirect3DRMMeshBuilder3_CreateMesh(&This->IDirect3DRMMeshBuilder3_iface, mesh);
return IDirect3DRMMeshBuilder3_CreateMesh(&mesh_builder->IDirect3DRMMeshBuilder3_iface, mesh);
}
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_GenerateNormals2(IDirect3DRMMeshBuilder2* iface,
@ -1749,12 +1745,9 @@ static D3DRMCOLORSOURCE WINAPI IDirect3DRMMeshBuilder3Impl_GetColorSource(IDirec
return E_NOTIMPL;
}
static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddMesh(IDirect3DRMMeshBuilder3* iface,
LPDIRECT3DRMMESH Mesh)
static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_AddMesh(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMMesh *mesh)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
FIXME("(%p)->(%p): stub\n", This, Mesh);
FIXME("iface %p, mesh %p stub!\n", iface, mesh);
return E_NOTIMPL;
}
@ -2079,8 +2072,7 @@ static D3DCOLOR WINAPI IDirect3DRMMeshBuilder3Impl_GetVertexColor(IDirect3DRMMes
return 0;
}
static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateMesh(IDirect3DRMMeshBuilder3* iface,
LPDIRECT3DRMMESH* mesh)
static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateMesh(IDirect3DRMMeshBuilder3 *iface, IDirect3DRMMesh **mesh)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder3(iface);
HRESULT hr;

View File

@ -227,7 +227,7 @@ static void test_MeshBuilder(void)
HRESULT hr;
IDirect3DRM *d3drm;
LPDIRECT3DRMMESHBUILDER pMeshBuilder;
LPDIRECT3DRMMESH mesh;
IDirect3DRMMesh *mesh;
D3DRMLOADMEMORY info;
int val;
DWORD val1, val2, val3;
@ -638,30 +638,30 @@ static void test_Mesh(void)
{
HRESULT hr;
IDirect3DRM *d3drm;
LPDIRECT3DRMMESH pMesh;
IDirect3DRMMesh *mesh;
DWORD size;
CHAR cname[64] = {0};
hr = pDirect3DRMCreate(&d3drm);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRM interface (hr = %x)\n", hr);
hr = IDirect3DRM_CreateMesh(d3drm, &pMesh);
hr = IDirect3DRM_CreateMesh(d3drm, &mesh);
ok(hr == D3DRM_OK, "Cannot get IDirect3DRMMesh interface (hr = %x)\n", hr);
hr = IDirect3DRMMesh_GetClassName(pMesh, NULL, cname);
hr = IDirect3DRMMesh_GetClassName(mesh, NULL, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
hr = IDirect3DRMMesh_GetClassName(pMesh, NULL, NULL);
hr = IDirect3DRMMesh_GetClassName(mesh, NULL, NULL);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = 1;
hr = IDirect3DRMMesh_GetClassName(pMesh, &size, cname);
hr = IDirect3DRMMesh_GetClassName(mesh, &size, cname);
ok(hr == E_INVALIDARG, "GetClassName failed with %x\n", hr);
size = sizeof(cname);
hr = IDirect3DRMMesh_GetClassName(pMesh, &size, cname);
hr = IDirect3DRMMesh_GetClassName(mesh, &size, cname);
ok(hr == D3DRM_OK, "Cannot get classname (hr = %x)\n", hr);
ok(size == sizeof("Mesh"), "wrong size: %u\n", size);
ok(!strcmp(cname, "Mesh"), "Expected cname to be \"Mesh\", but got \"%s\"\n", cname);
IDirect3DRMMesh_Release(pMesh);
IDirect3DRMMesh_Release(mesh);
IDirect3DRM_Release(d3drm);
}

View File

@ -59,7 +59,7 @@ DECLARE_INTERFACE_(IDirect3DRM,IUnknown)
/*** IDirect3DRM methods ***/
STDMETHOD(CreateObject)(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame *parent, IDirect3DRMFrame **frame) PURE;
STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH *) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER *) PURE;
STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE *) PURE;
STDMETHOD(CreateAnimation)(THIS_ LPDIRECT3DRMANIMATION *) PURE;
@ -197,7 +197,7 @@ DECLARE_INTERFACE_(IDirect3DRM2,IUnknown)
/*** IDirect3DRM2 methods ***/
STDMETHOD(CreateObject)(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame *parent, IDirect3DRMFrame2 **frame) PURE;
STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH *) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER2 *) PURE;
STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE *) PURE;
STDMETHOD(CreateAnimation)(THIS_ LPDIRECT3DRMANIMATION *) PURE;
@ -338,7 +338,7 @@ DECLARE_INTERFACE_(IDirect3DRM3,IUnknown)
/*** IDirect3DRM2 methods ***/
STDMETHOD(CreateObject)(THIS_ REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj) PURE;
STDMETHOD(CreateFrame)(THIS_ IDirect3DRMFrame3 *parent, IDirect3DRMFrame3 **frame) PURE;
STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH *) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(CreateMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3 *) PURE;
STDMETHOD(CreateFace)(THIS_ LPDIRECT3DRMFACE2 *) PURE;
STDMETHOD(CreateAnimation)(THIS_ LPDIRECT3DRMANIMATION2 *) PURE;

View File

@ -2038,7 +2038,7 @@ DECLARE_INTERFACE_(IDirect3DRMProgressiveMesh,IDirect3DRMVisual)
STDMETHOD(GetDetail) (THIS_ D3DVALUE *pdvVal) PURE;
STDMETHOD(SetDetail) (THIS_ D3DVALUE d3dVal) PURE;
STDMETHOD(RegisterEvents) (THIS_ HANDLE event, DWORD flags, DWORD reserved) PURE;
STDMETHOD(CreateMesh) (THIS_ LPDIRECT3DRMMESH *ppD3DRMMesh) PURE;
STDMETHOD(CreateMesh) (THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(Duplicate) (THIS_ LPDIRECT3DRMPROGRESSIVEMESH *ppD3DRMPMesh) PURE;
STDMETHOD(GetBox) (THIS_ D3DRMBOX *box) PURE;
STDMETHOD(SetQuality) (THIS_ D3DRMRENDERQUALITY quality) PURE;
@ -2509,7 +2509,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder,IDirect3DRMVisual)
STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
STDMETHOD(GenerateNormals)(THIS) PURE;
STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE;
STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE;
STDMETHOD(AddMesh)(THIS_ IDirect3DRMMesh *mesh) PURE;
STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE;
STDMETHOD(AddFrame)(THIS_ IDirect3DRMFrame *frame) PURE;
STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE;
@ -2540,7 +2540,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder,IDirect3DRMVisual)
STDMETHOD_(int, GetFaceCount)(THIS) PURE;
STDMETHOD_(int, GetVertexCount)(THIS) PURE;
STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE;
STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
};
#undef INTERFACE
@ -2680,7 +2680,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2,IDirect3DRMMeshBuilder)
STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
STDMETHOD(GenerateNormals)(THIS) PURE;
STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE;
STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE;
STDMETHOD(AddMesh)(THIS_ IDirect3DRMMesh *mesh) PURE;
STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER) PURE;
STDMETHOD(AddFrame)(THIS_ IDirect3DRMFrame *frame) PURE;
STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE) PURE;
@ -2711,7 +2711,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2,IDirect3DRMMeshBuilder)
STDMETHOD_(int, GetFaceCount)(THIS) PURE;
STDMETHOD_(int, GetVertexCount)(THIS) PURE;
STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE;
STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
/*** IDirect3DRMMeshBuilder2 methods ***/
STDMETHOD(GenerateNormals2)(THIS_ D3DVALUE crease, DWORD flags) PURE;
STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE*) PURE;
@ -2860,7 +2860,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder3,IDirect3DRMVisual)
STDMETHOD(GetBox)(THIS_ D3DRMBOX *) PURE;
STDMETHOD(GenerateNormals)(THIS_ D3DVALUE crease, DWORD flags) PURE;
STDMETHOD_(D3DRMCOLORSOURCE, GetColorSource)(THIS) PURE;
STDMETHOD(AddMesh)(THIS_ LPDIRECT3DRMMESH) PURE;
STDMETHOD(AddMesh)(THIS_ IDirect3DRMMesh *mesh) PURE;
STDMETHOD(AddMeshBuilder)(THIS_ LPDIRECT3DRMMESHBUILDER3, DWORD flags) PURE;
STDMETHOD(AddFrame)(THIS_ IDirect3DRMFrame3 *frame) PURE;
STDMETHOD(AddFace)(THIS_ LPDIRECT3DRMFACE2) PURE;
@ -2891,7 +2891,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder3,IDirect3DRMVisual)
STDMETHOD_(int, GetFaceCount)(THIS) PURE;
STDMETHOD_(int, GetVertexCount)(THIS) PURE;
STDMETHOD_(D3DCOLOR, GetVertexColor)(THIS_ DWORD index) PURE;
STDMETHOD(CreateMesh)(THIS_ LPDIRECT3DRMMESH*) PURE;
STDMETHOD(CreateMesh)(THIS_ IDirect3DRMMesh **mesh) PURE;
STDMETHOD(GetFace)(THIS_ DWORD index, LPDIRECT3DRMFACE2 *) PURE;
STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vector) PURE;
STDMETHOD(GetNormal)(THIS_ DWORD index, D3DVECTOR *vector) PURE;