Commit 56978219 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

d3drm: Added IDirect3DRMWrap stub.

parent 4ee9bbc8
......@@ -175,6 +175,19 @@ static HRESULT d3drm_create_animation_object(void **object, IDirect3DRM *d3drm)
return hr;
}
static HRESULT d3drm_create_wrap_object(void **object, IDirect3DRM *d3drm)
{
struct d3drm_wrap *wrap;
HRESULT hr;
if (FAILED(hr = d3drm_wrap_create(&wrap, d3drm)))
return hr;
*object = &wrap->IDirect3DRMWrap_iface;
return hr;
}
struct d3drm
{
IDirect3DRM IDirect3DRM_iface;
......@@ -593,11 +606,22 @@ static HRESULT WINAPI d3drm1_CreateWrap(IDirect3DRM *iface, D3DRMWRAPTYPE type,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
IDirect3DRMWrap **wrap)
{
struct d3drm_wrap *object;
HRESULT hr;
FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
"ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
"ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p, semi-stub.\n",
iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
return E_NOTIMPL;
if (!wrap)
return D3DRMERR_BADVALUE;
if (FAILED(hr = d3drm_wrap_create(&object, iface)))
return hr;
*wrap = &object->IDirect3DRMWrap_iface;
return S_OK;
}
static HRESULT WINAPI d3drm1_CreateUserVisual(IDirect3DRM *iface,
......@@ -1097,11 +1121,14 @@ static HRESULT WINAPI d3drm2_CreateWrap(IDirect3DRM2 *iface, D3DRMWRAPTYPE type,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
IDirect3DRMWrap **wrap)
{
FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
"ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
struct d3drm *d3drm = impl_from_IDirect3DRM2(iface);
TRACE("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
"ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p.\n",
iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
return E_NOTIMPL;
return IDirect3DRM_CreateWrap(&d3drm->IDirect3DRM_iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz,
ou, ov, su, sv, wrap);
}
static HRESULT WINAPI d3drm2_CreateUserVisual(IDirect3DRM2 *iface,
......@@ -1340,6 +1367,7 @@ static HRESULT WINAPI d3drm3_CreateObject(IDirect3DRM3 *iface,
{&CLSID_CDirect3DRMMaterial, d3drm_create_material_object},
{&CLSID_CDirect3DRMMesh, d3drm_create_mesh_object},
{&CLSID_CDirect3DRMAnimation, d3drm_create_animation_object},
{&CLSID_CDirect3DRMWrap, d3drm_create_wrap_object},
};
TRACE("iface %p, clsid %s, outer %p, iid %s, out %p.\n",
......@@ -1756,11 +1784,23 @@ static HRESULT WINAPI d3drm3_CreateWrap(IDirect3DRM3 *iface, D3DRMWRAPTYPE type,
D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv,
IDirect3DRMWrap **wrap)
{
struct d3drm *d3drm = impl_from_IDirect3DRM3(iface);
struct d3drm_wrap *object;
HRESULT hr;
FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
"ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
"ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p, semi-stub.\n",
iface, type, frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
return E_NOTIMPL;
if (!wrap)
return D3DRMERR_BADVALUE;
if (FAILED(hr = d3drm_wrap_create(&object, &d3drm->IDirect3DRM_iface)))
return hr;
*wrap = &object->IDirect3DRMWrap_iface;
return S_OK;
}
static HRESULT WINAPI d3drm3_CreateUserVisual(IDirect3DRM3 *iface,
......
......@@ -215,6 +215,12 @@ struct d3drm_animation
IDirect3DRM *d3drm;
};
struct d3drm_wrap
{
struct d3drm_object obj;
IDirect3DRMWrap IDirect3DRMWrap_iface;
LONG ref;
};
HRESULT d3drm_device_create(struct d3drm_device **device, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_device_create_surfaces_from_clipper(struct d3drm_device *object, IDirectDraw *ddraw,
......@@ -243,6 +249,7 @@ HRESULT d3drm_light_create(struct d3drm_light **light, IDirect3DRM *d3drm) DECLS
HRESULT d3drm_material_create(struct d3drm_material **material, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_mesh_create(struct d3drm_mesh **mesh, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_animation_create(struct d3drm_animation **animation, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT d3drm_wrap_create(struct d3drm_wrap **wrap, IDirect3DRM *d3drm) DECLSPEC_HIDDEN;
HRESULT load_mesh_data(IDirect3DRMMeshBuilder3 *iface, IDirectXFileData *data,
D3DRMLOADTEXTURECALLBACK load_texture_proc, void *arg) DECLSPEC_HIDDEN;
......
......@@ -307,6 +307,11 @@ static inline struct d3drm_mesh_builder *impl_from_IDirect3DRMMeshBuilder3(IDire
return CONTAINING_RECORD(iface, struct d3drm_mesh_builder, IDirect3DRMMeshBuilder3_iface);
}
static inline struct d3drm_wrap *impl_from_IDirect3DRMWrap(IDirect3DRMWrap *iface)
{
return CONTAINING_RECORD(iface, struct d3drm_wrap, IDirect3DRMWrap_iface);
}
static void clean_mesh_builder_data(struct d3drm_mesh_builder *mesh_builder)
{
DWORD i;
......@@ -2878,3 +2883,187 @@ HRESULT d3drm_mesh_create(struct d3drm_mesh **mesh, IDirect3DRM *d3drm)
return S_OK;
}
static HRESULT WINAPI d3drm_wrap_QueryInterface(IDirect3DRMWrap *iface, REFIID riid, void **out)
{
TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
if (IsEqualGUID(riid, &IID_IDirect3DRMWrap)
|| IsEqualGUID(riid, &IID_IDirect3DRMObject)
|| IsEqualGUID(riid, &IID_IUnknown))
{
IDirect3DRMWrap_AddRef(iface);
*out = iface;
return S_OK;
}
WARN("%s not implemented.\n", debugstr_guid(riid));
*out = NULL;
return CLASS_E_CLASSNOTAVAILABLE;
}
static ULONG WINAPI d3drm_wrap_AddRef(IDirect3DRMWrap *iface)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
ULONG refcount = InterlockedIncrement(&wrap->ref);
TRACE("%p increasing refcount to %u.\n", iface, refcount);
return refcount;
}
static ULONG WINAPI d3drm_wrap_Release(IDirect3DRMWrap *iface)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
ULONG refcount = InterlockedDecrement(&wrap->ref);
TRACE("%p decreasing refcount to %u.\n", iface, refcount);
if (!refcount)
{
d3drm_object_cleanup((IDirect3DRMObject *)iface, &wrap->obj);
HeapFree(GetProcessHeap(), 0, wrap);
}
return refcount;
}
static HRESULT WINAPI d3drm_wrap_Clone(IDirect3DRMWrap *iface,
IUnknown *outer, REFIID iid, void **out)
{
FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_wrap_AddDestroyCallback(IDirect3DRMWrap *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_add_destroy_callback(&wrap->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_wrap_DeleteDestroyCallback(IDirect3DRMWrap *iface,
D3DRMOBJECTCALLBACK cb, void *ctx)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
return d3drm_object_delete_destroy_callback(&wrap->obj, cb, ctx);
}
static HRESULT WINAPI d3drm_wrap_SetAppData(IDirect3DRMWrap *iface, DWORD data)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p, data %#x.\n", iface, data);
wrap->obj.appdata = data;
return D3DRM_OK;
}
static DWORD WINAPI d3drm_wrap_GetAppData(IDirect3DRMWrap *iface)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p.\n", iface);
return wrap->obj.appdata;
}
static HRESULT WINAPI d3drm_wrap_SetName(IDirect3DRMWrap *iface, const char *name)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
return d3drm_object_set_name(&wrap->obj, name);
}
static HRESULT WINAPI d3drm_wrap_GetName(IDirect3DRMWrap *iface, DWORD *size, char *name)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_name(&wrap->obj, size, name);
}
static HRESULT WINAPI d3drm_wrap_GetClassName(IDirect3DRMWrap *iface, DWORD *size, char *name)
{
struct d3drm_wrap *wrap = impl_from_IDirect3DRMWrap(iface);
TRACE("iface %p, size %p, name %p.\n", iface, size, name);
return d3drm_object_get_class_name(&wrap->obj, size, name);
}
static HRESULT WINAPI d3drm_wrap_Init(IDirect3DRMWrap *iface, D3DRMWRAPTYPE type, IDirect3DRMFrame *reference,
D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux,
D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv)
{
FIXME("iface %p, type %d, reference frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, ux %.8e, "
"uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e.\n", iface, type, reference, ox, oy, oz, dx, dy, dz,
ux, uy, uz, ou, ov, su, sv);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_wrap_Apply(IDirect3DRMWrap *iface, IDirect3DRMObject *object)
{
FIXME("iface %p, object %p.\n", iface, object);
return E_NOTIMPL;
}
static HRESULT WINAPI d3drm_wrap_ApplyRelative(IDirect3DRMWrap *iface, IDirect3DRMFrame *frame,
IDirect3DRMObject *object)
{
FIXME("iface %p, frame %p, object %p.\n", iface, frame, object);
return E_NOTIMPL;
}
static const struct IDirect3DRMWrapVtbl d3drm_wrap_vtbl =
{
d3drm_wrap_QueryInterface,
d3drm_wrap_AddRef,
d3drm_wrap_Release,
d3drm_wrap_Clone,
d3drm_wrap_AddDestroyCallback,
d3drm_wrap_DeleteDestroyCallback,
d3drm_wrap_SetAppData,
d3drm_wrap_GetAppData,
d3drm_wrap_SetName,
d3drm_wrap_GetName,
d3drm_wrap_GetClassName,
d3drm_wrap_Init,
d3drm_wrap_Apply,
d3drm_wrap_ApplyRelative,
};
HRESULT d3drm_wrap_create(struct d3drm_wrap **wrap, IDirect3DRM *d3drm)
{
static const char classname[] = "";
struct d3drm_wrap *object;
TRACE("wrap %p, d3drm %p.\n", wrap, d3drm);
if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
return E_OUTOFMEMORY;
object->IDirect3DRMWrap_iface.lpVtbl = &d3drm_wrap_vtbl;
object->ref = 1;
d3drm_object_init(&object->obj, classname);
*wrap = object;
return S_OK;
}
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