d3drm: Avoid LPDIRECT3DRMMATERIAL.

This commit is contained in:
Henri Verbeet 2013-05-28 08:55:21 +02:00 committed by Alexandre Julliard
parent 397cc3f42d
commit 19a519e90a
6 changed files with 47 additions and 47 deletions

View File

@ -217,13 +217,14 @@ static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM *iface, D3DRMLI
return IDirect3DRM3_CreateLightRGB(&d3drm->IDirect3DRM3_iface, type, red, green, blue, light);
}
static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM* iface, D3DVALUE power, LPDIRECT3DRMMATERIAL * material)
static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM *iface,
D3DVALUE power, IDirect3DRMMaterial **material)
{
IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM(iface);
TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
TRACE("iface %p, power %.8e, material %p.\n", iface, power, material);
return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
return IDirect3DRM3_CreateMaterial(&d3drm->IDirect3DRM3_iface, power, (IDirect3DRMMaterial2 **)material);
}
static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM *iface,
@ -594,14 +595,14 @@ static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2 *iface, D3DRM
return IDirect3DRM3_CreateLightRGB(&d3drm->IDirect3DRM3_iface, type, red, green, blue, light);
}
static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE power,
LPDIRECT3DRMMATERIAL * material)
static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2 *iface,
D3DVALUE power, IDirect3DRMMaterial **material)
{
IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
IDirect3DRMImpl *d3drm = impl_from_IDirect3DRM2(iface);
TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
TRACE("iface %p, power %.8e, material %p.\n", iface, power, material);
return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
return IDirect3DRM3_CreateMaterial(&d3drm->IDirect3DRM3_iface, power, (IDirect3DRMMaterial2 **)material);
}
static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2 *iface,

View File

@ -1246,12 +1246,9 @@ static HRESULT WINAPI IDirect3DRMFrame2Impl_GetAxes(IDirect3DRMFrame2 *iface,
return E_NOTIMPL;
}
static HRESULT WINAPI IDirect3DRMFrame2Impl_GetMaterial(IDirect3DRMFrame2* iface,
LPDIRECT3DRMMATERIAL *material)
static HRESULT WINAPI IDirect3DRMFrame2Impl_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
{
IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
FIXME("(%p/%p)->(%p): stub\n", iface, This, material);
FIXME("iface %p, material %p stub!\n", iface, material);
return E_NOTIMPL;
}

View File

@ -675,14 +675,15 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTexture(IDirect3DRMMeshBuil
return hr;
}
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetMaterial(IDirect3DRMMeshBuilder2* iface,
LPDIRECT3DRMMATERIAL material)
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetMaterial(IDirect3DRMMeshBuilder2 *iface,
IDirect3DRMMaterial *material)
{
IDirect3DRMMeshBuilderImpl *This = impl_from_IDirect3DRMMeshBuilder2(iface);
IDirect3DRMMeshBuilderImpl *d3drm = impl_from_IDirect3DRMMeshBuilder2(iface);
TRACE("(%p)->(%p)\n", This, material);
TRACE("iface %p, material %p.\n", iface, material);
return IDirect3DRMMeshBuilder3_SetMaterial(&This->IDirect3DRMMeshBuilder3_iface, (LPDIRECT3DRMMATERIAL2)material);
return IDirect3DRMMeshBuilder3_SetMaterial(&d3drm->IDirect3DRMMeshBuilder3_iface,
(IDirect3DRMMaterial2 *)material);
}
static HRESULT WINAPI IDirect3DRMMeshBuilder2Impl_SetTextureTopology(IDirect3DRMMeshBuilder2* iface,
@ -2166,7 +2167,8 @@ static HRESULT WINAPI IDirect3DRMMeshBuilder3Impl_CreateMesh(IDirect3DRMMeshBuil
if (SUCCEEDED(hr))
hr = IDirect3DRMMesh_SetGroupColor(*mesh, group, This->materials[k].color);
if (SUCCEEDED(hr))
hr = IDirect3DRMMesh_SetGroupMaterial(*mesh, group, (LPDIRECT3DRMMATERIAL)This->materials[k].material);
hr = IDirect3DRMMesh_SetGroupMaterial(*mesh, group,
(IDirect3DRMMaterial *)This->materials[k].material);
if (SUCCEEDED(hr) && This->materials[k].texture)
{
IDirect3DRMTexture *texture;
@ -2836,23 +2838,23 @@ static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupQuality(IDirect3DRMMesh* iface
return E_NOTIMPL;
}
static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupMaterial(IDirect3DRMMesh* iface,
D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL material)
static HRESULT WINAPI IDirect3DRMMeshImpl_SetGroupMaterial(IDirect3DRMMesh *iface,
D3DRMGROUPINDEX id, IDirect3DRMMaterial *material)
{
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
IDirect3DRMMeshImpl *mesh = impl_from_IDirect3DRMMesh(iface);
TRACE("(%p)->(%u,%p)\n", This, id, material);
TRACE("iface %p, id %#x, material %p.\n", iface, id, material);
if (id >= This->nb_groups)
if (id >= mesh->nb_groups)
return D3DRMERR_BADVALUE;
if (This->groups[id].material)
IDirect3DRMMaterial2_Release(This->groups[id].material);
if (mesh->groups[id].material)
IDirect3DRMMaterial2_Release(mesh->groups[id].material);
This->groups[id].material = (LPDIRECT3DRMMATERIAL2)material;
mesh->groups[id].material = (IDirect3DRMMaterial2 *)material;
if (material)
IDirect3DRMMaterial2_AddRef(This->groups[id].material);
IDirect3DRMMaterial2_AddRef(mesh->groups[id].material);
return D3DRM_OK;
}
@ -2960,21 +2962,21 @@ static D3DRMRENDERQUALITY WINAPI IDirect3DRMMeshImpl_GetGroupQuality(IDirect3DRM
return 0;
}
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupMaterial(IDirect3DRMMesh* iface,
D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *material)
static HRESULT WINAPI IDirect3DRMMeshImpl_GetGroupMaterial(IDirect3DRMMesh *iface,
D3DRMGROUPINDEX id, IDirect3DRMMaterial **material)
{
IDirect3DRMMeshImpl *This = impl_from_IDirect3DRMMesh(iface);
IDirect3DRMMeshImpl *mesh = impl_from_IDirect3DRMMesh(iface);
TRACE("(%p)->(%u,%p)\n", This, id, material);
TRACE("iface %p, id %#x, material %p.\n", iface, id, material);
if (id >= This->nb_groups)
if (id >= mesh->nb_groups)
return D3DRMERR_BADVALUE;
if (!material)
return E_POINTER;
if (This->groups[id].material)
IDirect3DRMTexture_QueryInterface(This->groups[id].material, &IID_IDirect3DRMMaterial, (void**)material);
if (mesh->groups[id].material)
IDirect3DRMTexture_QueryInterface(mesh->groups[id].material, &IID_IDirect3DRMMaterial, (void **)material);
else
*material = NULL;

View File

@ -450,7 +450,7 @@ static void test_MeshBuilder(void)
DWORD nb_groups;
unsigned nb_vertices, nb_faces, nb_face_vertices;
DWORD data_size;
LPDIRECT3DRMMATERIAL material = (LPDIRECT3DRMMATERIAL)0xdeadbeef;
IDirect3DRMMaterial *material = (IDirect3DRMMaterial *)0xdeadbeef;
IDirect3DRMTexture *texture = (IDirect3DRMTexture *)0xdeadbeef;
D3DVALUE values[3];

View File

@ -68,7 +68,7 @@ DECLARE_INTERFACE_(IDirect3DRM,IUnknown)
STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE;
STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b,
IDirect3DRMLight **light) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE power, IDirect3DRMMaterial **material) PURE;
STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice **device) PURE;
STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw,
IDirectDrawSurface *surface, IDirect3DRMDevice **device) PURE;
@ -207,7 +207,7 @@ DECLARE_INTERFACE_(IDirect3DRM2,IUnknown)
STDMETHOD(CreateLight)(THIS_ D3DRMLIGHTTYPE type, D3DCOLOR color, IDirect3DRMLight **light) PURE;
STDMETHOD(CreateLightRGB)(THIS_ D3DRMLIGHTTYPE type, D3DVALUE r, D3DVALUE g, D3DVALUE b,
IDirect3DRMLight **light) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE, LPDIRECT3DRMMATERIAL *) PURE;
STDMETHOD(CreateMaterial)(THIS_ D3DVALUE power, IDirect3DRMMaterial **material) PURE;
STDMETHOD(CreateDevice)(THIS_ DWORD width, DWORD height, IDirect3DRMDevice2 **device) PURE;
STDMETHOD(CreateDeviceFromSurface)(THIS_ GUID *guid, IDirectDraw *ddraw,
IDirectDrawSurface *surface, IDirect3DRMDevice2 **device) PURE;

View File

@ -1396,14 +1396,14 @@ DECLARE_INTERFACE_(IDirect3DRMFrame2,IDirect3DRMFrame)
STDMETHOD(GetBox)(THIS_ D3DRMBOX *box) PURE;
STDMETHOD_(BOOL, GetBoxEnable)(THIS) PURE;
STDMETHOD(GetAxes)(THIS_ D3DVECTOR *dir, D3DVECTOR *up);
STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE;
STDMETHOD(GetMaterial)(THIS_ struct IDirect3DRMMaterial **material) PURE;
STDMETHOD_(BOOL, GetInheritAxes)(THIS);
STDMETHOD(GetHierarchyBox)(THIS_ D3DRMBOX *box) PURE;
STDMETHOD(SetBox)(THIS_ D3DRMBOX *box) PURE;
STDMETHOD(SetBoxEnable)(THIS_ BOOL) PURE;
STDMETHOD(SetAxes)(THIS_ D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz);
STDMETHOD(SetInheritAxes)(THIS_ BOOL inherit_from_parent);
STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE;
STDMETHOD(SetQuaternion)(THIS_ IDirect3DRMFrame *reference, D3DRMQUATERNION *q) PURE;
STDMETHOD(RayPick)(THIS_ IDirect3DRMFrame *reference, D3DRMRAY *ray, DWORD flags,
struct IDirect3DRMPicked2Array **return_visuals) PURE;
@ -1920,7 +1920,7 @@ DECLARE_INTERFACE_(IDirect3DRMMesh,IDirect3DRMVisual)
STDMETHOD(SetGroupColorRGB)(THIS_ D3DRMGROUPINDEX id, D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
STDMETHOD(SetGroupMapping)(THIS_ D3DRMGROUPINDEX id, D3DRMMAPPING value) PURE;
STDMETHOD(SetGroupQuality)(THIS_ D3DRMGROUPINDEX id, D3DRMRENDERQUALITY value) PURE;
STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL value) PURE;
STDMETHOD(SetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMMaterial *material) PURE;
STDMETHOD(SetGroupTexture)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMTexture *texture) PURE;
STDMETHOD_(unsigned, GetGroupCount)(THIS) PURE;
STDMETHOD(GetGroup)(THIS_ D3DRMGROUPINDEX id, unsigned *vCount, unsigned *fCount, unsigned *vPerFace,
@ -1929,7 +1929,7 @@ DECLARE_INTERFACE_(IDirect3DRMMesh,IDirect3DRMVisual)
STDMETHOD_(D3DCOLOR, GetGroupColor)(THIS_ D3DRMGROUPINDEX id) PURE;
STDMETHOD_(D3DRMMAPPING, GetGroupMapping)(THIS_ D3DRMGROUPINDEX id) PURE;
STDMETHOD_(D3DRMRENDERQUALITY, GetGroupQuality)(THIS_ D3DRMGROUPINDEX id) PURE;
STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, LPDIRECT3DRMMATERIAL *returnPtr) PURE;
STDMETHOD(GetGroupMaterial)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMMaterial **material) PURE;
STDMETHOD(GetGroupTexture)(THIS_ D3DRMGROUPINDEX id, struct IDirect3DRMTexture **texture) PURE;
};
#undef INTERFACE
@ -2287,7 +2287,7 @@ DECLARE_INTERFACE_(IDirect3DRMFace,IDirect3DRMObject)
STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE;
STDMETHOD(SetTextureCoordinates)(THIS_ DWORD vertex, D3DVALUE u, D3DVALUE v) PURE;
STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE;
STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
STDMETHOD(GetVertex)(THIS_ DWORD index, D3DVECTOR *vertex, D3DVECTOR *normal) PURE;
STDMETHOD(GetVertices)(THIS_ DWORD *vertex_count, D3DVECTOR *coords, D3DVECTOR *normals);
@ -2295,7 +2295,7 @@ DECLARE_INTERFACE_(IDirect3DRMFace,IDirect3DRMObject)
STDMETHOD(GetTextureTopology)(THIS_ BOOL *wrap_u, BOOL *wrap_v) PURE;
STDMETHOD(GetNormal)(THIS_ D3DVECTOR *) PURE;
STDMETHOD(GetTexture)(THIS_ struct IDirect3DRMTexture **texture) PURE;
STDMETHOD(GetMaterial)(THIS_ LPDIRECT3DRMMATERIAL *) PURE;
STDMETHOD(GetMaterial)(THIS_ struct IDirect3DRMMaterial **material) PURE;
STDMETHOD_(int, GetVertexCount)(THIS) PURE;
STDMETHOD_(int, GetVertexIndex)(THIS_ DWORD which) PURE;
STDMETHOD_(int, GetTextureCoordinateIndex)(THIS_ DWORD which) PURE;
@ -2519,7 +2519,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder,IDirect3DRMVisual)
STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE;
STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE;
STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
STDMETHOD(SetPerspective)(THIS_ BOOL) PURE;
@ -2690,7 +2690,7 @@ DECLARE_INTERFACE_(IDirect3DRMMeshBuilder2,IDirect3DRMMeshBuilder)
STDMETHOD(SetColorRGB)(THIS_ D3DVALUE red, D3DVALUE green, D3DVALUE blue) PURE;
STDMETHOD(SetColor)(THIS_ D3DCOLOR) PURE;
STDMETHOD(SetTexture)(THIS_ struct IDirect3DRMTexture *texture) PURE;
STDMETHOD(SetMaterial)(THIS_ LPDIRECT3DRMMATERIAL) PURE;
STDMETHOD(SetMaterial)(THIS_ struct IDirect3DRMMaterial *material) PURE;
STDMETHOD(SetTextureTopology)(THIS_ BOOL wrap_u, BOOL wrap_v) PURE;
STDMETHOD(SetQuality)(THIS_ D3DRMRENDERQUALITY) PURE;
STDMETHOD(SetPerspective)(THIS_ BOOL) PURE;