2 * Implementation of IDirect3DRM Interface
4 * Copyright 2010, 2012 Christian Costa
5 * Copyright 2011 André Hentschel
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #include "wine/debug.h"
31 #include "d3drm_private.h"
33 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
35 static const char* get_IID_string(const GUID
* guid
)
37 if (IsEqualGUID(guid
, &IID_IDirect3DRMFrame
))
38 return "IID_IDirect3DRMFrame";
39 else if (IsEqualGUID(guid
, &IID_IDirect3DRMFrame2
))
40 return "IID_IDirect3DRMFrame2";
41 else if (IsEqualGUID(guid
, &IID_IDirect3DRMFrame3
))
42 return "IID_IDirect3DRMFrame3";
43 else if (IsEqualGUID(guid
, &IID_IDirect3DRMMeshBuilder
))
44 return "IID_IDirect3DRMMeshBuilder";
45 else if (IsEqualGUID(guid
, &IID_IDirect3DRMMeshBuilder2
))
46 return "IID_IDirect3DRMMeshBuilder2";
47 else if (IsEqualGUID(guid
, &IID_IDirect3DRMMeshBuilder3
))
48 return "IID_IDirect3DRMMeshBuilder3";
54 IDirect3DRM IDirect3DRM_iface
;
55 IDirect3DRM2 IDirect3DRM2_iface
;
56 IDirect3DRM3 IDirect3DRM3_iface
;
60 static inline IDirect3DRMImpl
*impl_from_IDirect3DRM(IDirect3DRM
*iface
)
62 return CONTAINING_RECORD(iface
, IDirect3DRMImpl
, IDirect3DRM_iface
);
65 static inline IDirect3DRMImpl
*impl_from_IDirect3DRM2(IDirect3DRM2
*iface
)
67 return CONTAINING_RECORD(iface
, IDirect3DRMImpl
, IDirect3DRM2_iface
);
70 static inline IDirect3DRMImpl
*impl_from_IDirect3DRM3(IDirect3DRM3
*iface
)
72 return CONTAINING_RECORD(iface
, IDirect3DRMImpl
, IDirect3DRM3_iface
);
75 /*** IUnknown methods ***/
76 static HRESULT WINAPI
IDirect3DRMImpl_QueryInterface(IDirect3DRM
* iface
, REFIID riid
, void** ppvObject
)
78 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
80 TRACE("(%p/%p)->(%s,%p)\n", iface
, This
, debugstr_guid(riid
), ppvObject
);
84 if(IsEqualGUID(riid
, &IID_IUnknown
) ||
85 IsEqualGUID(riid
, &IID_IDirect3DRM
))
87 *ppvObject
= &This
->IDirect3DRM_iface
;
89 else if(IsEqualGUID(riid
, &IID_IDirect3DRM2
))
91 *ppvObject
= &This
->IDirect3DRM2_iface
;
93 else if(IsEqualGUID(riid
, &IID_IDirect3DRM3
))
95 *ppvObject
= &This
->IDirect3DRM3_iface
;
99 FIXME("interface %s not implemented\n", debugstr_guid(riid
));
100 return E_NOINTERFACE
;
103 IDirect3DRM_AddRef(iface
);
107 static ULONG WINAPI
IDirect3DRMImpl_AddRef(IDirect3DRM
* iface
)
109 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
110 ULONG ref
= InterlockedIncrement(&This
->ref
);
112 TRACE("(%p/%p)->(): new ref = %d\n", iface
, This
, ref
);
117 static ULONG WINAPI
IDirect3DRMImpl_Release(IDirect3DRM
* iface
)
119 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
120 ULONG ref
= InterlockedDecrement(&This
->ref
);
122 TRACE("(%p/%p)->(): new ref = %d\n", iface
, This
, ref
);
125 HeapFree(GetProcessHeap(), 0, This
);
130 /*** IDirect3DRM methods ***/
131 static HRESULT WINAPI
IDirect3DRMImpl_CreateObject(IDirect3DRM
* iface
, REFCLSID rclsid
, LPUNKNOWN pUnkOuter
, REFIID riid
, LPVOID
*ppvObj
)
133 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
135 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface
, This
, debugstr_guid(rclsid
), pUnkOuter
, debugstr_guid(riid
), ppvObj
);
140 static HRESULT WINAPI
IDirect3DRMImpl_CreateFrame(IDirect3DRM
*iface
,
141 IDirect3DRMFrame
*parent_frame
, IDirect3DRMFrame
**frame
)
143 TRACE("iface %p, parent_frame %p, frame %p.\n", iface
, parent_frame
, frame
);
145 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame
, (IUnknown
*)parent_frame
, (IUnknown
**)frame
);
148 static HRESULT WINAPI
IDirect3DRMImpl_CreateMesh(IDirect3DRM
*iface
, IDirect3DRMMesh
**mesh
)
150 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM(iface
);
152 TRACE("iface %p, mesh %p.\n", iface
, mesh
);
154 return IDirect3DRM3_CreateMesh(&d3drm
->IDirect3DRM3_iface
, mesh
);
157 static HRESULT WINAPI
IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM
*iface
, IDirect3DRMMeshBuilder
**mesh_builder
)
159 TRACE("iface %p, mesh_builder %p.\n", iface
, mesh_builder
);
161 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder
, (IUnknown
**)mesh_builder
);
164 static HRESULT WINAPI
IDirect3DRMImpl_CreateFace(IDirect3DRM
* iface
, IDirect3DRMFace
**face
)
166 TRACE("iface %p, face %p.\n", iface
, face
);
168 return Direct3DRMFace_create(&IID_IDirect3DRMFace
, (IUnknown
**)face
);
171 static HRESULT WINAPI
IDirect3DRMImpl_CreateAnimation(IDirect3DRM
*iface
, IDirect3DRMAnimation
**animation
)
173 FIXME("iface %p, animation %p stub!\n", iface
, animation
);
178 static HRESULT WINAPI
IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM
*iface
, IDirect3DRMAnimationSet
**set
)
180 FIXME("iface %p, set %p stub!\n", iface
, set
);
185 static HRESULT WINAPI
IDirect3DRMImpl_CreateTexture(IDirect3DRM
*iface
,
186 D3DRMIMAGE
*image
, IDirect3DRMTexture
**texture
)
188 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
190 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface
, This
, image
, texture
);
192 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture
, (IUnknown
**)texture
);
195 static HRESULT WINAPI
IDirect3DRMImpl_CreateLight(IDirect3DRM
*iface
,
196 D3DRMLIGHTTYPE type
, D3DCOLOR color
, IDirect3DRMLight
**light
)
198 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM(iface
);
200 TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface
, type
, color
, light
);
202 return IDirect3DRM3_CreateLight(&d3drm
->IDirect3DRM3_iface
, type
, color
, light
);
205 static HRESULT WINAPI
IDirect3DRMImpl_CreateLightRGB(IDirect3DRM
*iface
, D3DRMLIGHTTYPE type
,
206 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, IDirect3DRMLight
**light
)
208 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM(iface
);
210 TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n",
211 iface
, type
, red
, green
, blue
, light
);
213 return IDirect3DRM3_CreateLightRGB(&d3drm
->IDirect3DRM3_iface
, type
, red
, green
, blue
, light
);
216 static HRESULT WINAPI
IDirect3DRMImpl_CreateMaterial(IDirect3DRM
*iface
,
217 D3DVALUE power
, IDirect3DRMMaterial
**material
)
219 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM(iface
);
221 TRACE("iface %p, power %.8e, material %p.\n", iface
, power
, material
);
223 return IDirect3DRM3_CreateMaterial(&d3drm
->IDirect3DRM3_iface
, power
, (IDirect3DRMMaterial2
**)material
);
226 static HRESULT WINAPI
IDirect3DRMImpl_CreateDevice(IDirect3DRM
*iface
,
227 DWORD width
, DWORD height
, IDirect3DRMDevice
**device
)
229 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface
, width
, height
, device
);
231 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice
, (IUnknown
**)device
);
234 static HRESULT WINAPI
IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM
*iface
, GUID
*pGUID
,
235 IDirectDraw
*pDD
, IDirectDrawSurface
*pDDSBack
, IDirect3DRMDevice
**ppDevice
)
237 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
239 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface
, This
, debugstr_guid(pGUID
), pDD
,
242 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice
, (IUnknown
**)ppDevice
);
245 static HRESULT WINAPI
IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM
*iface
,
246 IDirect3D
*pD3D
, IDirect3DDevice
*pD3DDev
, IDirect3DRMDevice
**ppDevice
)
248 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
250 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface
, This
, pD3D
, pD3DDev
, ppDevice
);
252 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice
, (IUnknown
**)ppDevice
);
255 static HRESULT WINAPI
IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM
*iface
,
256 IDirectDrawClipper
*pDDClipper
, GUID
*pGUID
, int width
, int height
,
257 IDirect3DRMDevice
**ppDevice
)
259 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
261 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface
, This
, pDDClipper
,
262 debugstr_guid(pGUID
), width
, height
, ppDevice
);
264 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice
, (IUnknown
**)ppDevice
);
267 static HRESULT WINAPI
IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM
*iface
,
268 IDirectDrawSurface
*pDDS
, IDirect3DRMTexture
**ppTexture
)
270 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
272 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, pDDS
, ppTexture
);
277 static HRESULT WINAPI
IDirect3DRMImpl_CreateShadow(IDirect3DRM
*iface
, IDirect3DRMVisual
*visual
,
278 IDirect3DRMLight
*light
, D3DVALUE px
, D3DVALUE py
, D3DVALUE pz
, D3DVALUE nx
, D3DVALUE ny
, D3DVALUE nz
,
279 IDirect3DRMVisual
**shadow
)
281 FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
282 iface
, visual
, light
, px
, py
, pz
, nx
, ny
, nz
, shadow
);
287 static HRESULT WINAPI
IDirect3DRMImpl_CreateViewport(IDirect3DRM
*iface
, IDirect3DRMDevice
*device
,
288 IDirect3DRMFrame
*camera
, DWORD x
, DWORD y
, DWORD width
, DWORD height
, IDirect3DRMViewport
**viewport
)
290 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
291 iface
, device
, camera
, x
, y
, width
, height
, viewport
);
293 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport
, (IUnknown
**)viewport
);
296 static HRESULT WINAPI
IDirect3DRMImpl_CreateWrap(IDirect3DRM
*iface
, D3DRMWRAPTYPE type
, IDirect3DRMFrame
*frame
,
297 D3DVALUE ox
, D3DVALUE oy
, D3DVALUE oz
, D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
,
298 D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
, D3DVALUE ou
, D3DVALUE ov
, D3DVALUE su
, D3DVALUE sv
,
299 IDirect3DRMWrap
**wrap
)
301 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
302 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
303 iface
, type
, frame
, ox
, oy
, oz
, dx
, dy
, dz
, ux
, uy
, uz
, ou
, ov
, su
, sv
, wrap
);
308 static HRESULT WINAPI
IDirect3DRMImpl_CreateUserVisual(IDirect3DRM
*iface
,
309 D3DRMUSERVISUALCALLBACK cb
, void *ctx
, IDirect3DRMUserVisual
**visual
)
311 FIXME("iface %p, cb %p, ctx %p visual %p stub!\n", iface
, cb
, ctx
, visual
);
316 static HRESULT WINAPI
IDirect3DRMImpl_LoadTexture(IDirect3DRM
*iface
,
317 const char *filename
, IDirect3DRMTexture
**texture
)
319 FIXME("iface %p, filename %s, texture %p stub!\n", iface
, debugstr_a(filename
), texture
);
321 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture
, (IUnknown
**)texture
);
324 static HRESULT WINAPI
IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM
*iface
,
325 HRSRC resource
, IDirect3DRMTexture
**texture
)
327 FIXME("iface %p, resource %p, texture %p stub!\n", iface
, resource
, texture
);
329 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture
, (IUnknown
**)texture
);
332 static HRESULT WINAPI
IDirect3DRMImpl_SetSearchPath(IDirect3DRM
* iface
, LPCSTR path
)
334 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
336 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
341 static HRESULT WINAPI
IDirect3DRMImpl_AddSearchPath(IDirect3DRM
* iface
, LPCSTR path
)
343 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
345 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
350 static HRESULT WINAPI
IDirect3DRMImpl_GetSearchPath(IDirect3DRM
* iface
, DWORD
*size_return
, LPSTR path_return
)
352 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
354 FIXME("(%p/%p)->(%p,%s): stub\n", iface
, This
, size_return
, path_return
);
359 static HRESULT WINAPI
IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM
* iface
, DWORD nb_colors
)
361 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
363 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_colors
);
368 static HRESULT WINAPI
IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM
* iface
, DWORD nb_shades
)
370 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
372 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_shades
);
377 static HRESULT WINAPI
IDirect3DRMImpl_GetDevices(IDirect3DRM
* iface
, LPDIRECT3DRMDEVICEARRAY
* ppDeviceArray
)
379 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
381 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppDeviceArray
);
386 static HRESULT WINAPI
IDirect3DRMImpl_GetNamedObject(IDirect3DRM
*iface
,
387 const char *name
, IDirect3DRMObject
**object
)
389 FIXME("iface %p, name %s, object %p stub!\n", iface
, debugstr_a(name
), object
);
394 static HRESULT WINAPI
IDirect3DRMImpl_EnumerateObjects(IDirect3DRM
* iface
, D3DRMOBJECTCALLBACK cb
, LPVOID pArg
)
396 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
398 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, cb
, pArg
);
403 static HRESULT WINAPI
IDirect3DRMImpl_Load(IDirect3DRM
*iface
, void *source
, void *object_id
, IID
**iids
,
404 DWORD iid_count
, D3DRMLOADOPTIONS flags
, D3DRMLOADCALLBACK load_cb
, void *load_ctx
,
405 D3DRMLOADTEXTURECALLBACK load_tex_cb
, void *load_tex_ctx
, IDirect3DRMFrame
*parent_frame
)
407 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM(iface
);
408 IDirect3DRMFrame3
*parent_frame3
= NULL
;
409 HRESULT hr
= D3DRM_OK
;
411 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
412 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
413 iface
, source
, object_id
, iids
, iid_count
, flags
,
414 load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
417 hr
= IDirect3DRMFrame_QueryInterface(parent_frame
, &IID_IDirect3DRMFrame3
, (void **)&parent_frame3
);
419 hr
= IDirect3DRM3_Load(&d3drm
->IDirect3DRM3_iface
, source
, object_id
, iids
, iid_count
,
420 flags
, load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame3
);
422 IDirect3DRMFrame3_Release(parent_frame3
);
427 static HRESULT WINAPI
IDirect3DRMImpl_Tick(IDirect3DRM
* iface
, D3DVALUE tick
)
429 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM(iface
);
431 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, tick
);
436 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl
=
438 IDirect3DRMImpl_QueryInterface
,
439 IDirect3DRMImpl_AddRef
,
440 IDirect3DRMImpl_Release
,
441 IDirect3DRMImpl_CreateObject
,
442 IDirect3DRMImpl_CreateFrame
,
443 IDirect3DRMImpl_CreateMesh
,
444 IDirect3DRMImpl_CreateMeshBuilder
,
445 IDirect3DRMImpl_CreateFace
,
446 IDirect3DRMImpl_CreateAnimation
,
447 IDirect3DRMImpl_CreateAnimationSet
,
448 IDirect3DRMImpl_CreateTexture
,
449 IDirect3DRMImpl_CreateLight
,
450 IDirect3DRMImpl_CreateLightRGB
,
451 IDirect3DRMImpl_CreateMaterial
,
452 IDirect3DRMImpl_CreateDevice
,
453 IDirect3DRMImpl_CreateDeviceFromSurface
,
454 IDirect3DRMImpl_CreateDeviceFromD3D
,
455 IDirect3DRMImpl_CreateDeviceFromClipper
,
456 IDirect3DRMImpl_CreateTextureFromSurface
,
457 IDirect3DRMImpl_CreateShadow
,
458 IDirect3DRMImpl_CreateViewport
,
459 IDirect3DRMImpl_CreateWrap
,
460 IDirect3DRMImpl_CreateUserVisual
,
461 IDirect3DRMImpl_LoadTexture
,
462 IDirect3DRMImpl_LoadTextureFromResource
,
463 IDirect3DRMImpl_SetSearchPath
,
464 IDirect3DRMImpl_AddSearchPath
,
465 IDirect3DRMImpl_GetSearchPath
,
466 IDirect3DRMImpl_SetDefaultTextureColors
,
467 IDirect3DRMImpl_SetDefaultTextureShades
,
468 IDirect3DRMImpl_GetDevices
,
469 IDirect3DRMImpl_GetNamedObject
,
470 IDirect3DRMImpl_EnumerateObjects
,
471 IDirect3DRMImpl_Load
,
476 /*** IUnknown methods ***/
477 static HRESULT WINAPI
IDirect3DRM2Impl_QueryInterface(IDirect3DRM2
* iface
, REFIID riid
,
480 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
481 return IDirect3DRM_QueryInterface(&This
->IDirect3DRM_iface
, riid
, ppvObject
);
484 static ULONG WINAPI
IDirect3DRM2Impl_AddRef(IDirect3DRM2
* iface
)
486 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
487 return IDirect3DRM_AddRef(&This
->IDirect3DRM_iface
);
490 static ULONG WINAPI
IDirect3DRM2Impl_Release(IDirect3DRM2
* iface
)
492 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
493 return IDirect3DRM_Release(&This
->IDirect3DRM_iface
);
496 /*** IDirect3DRM2 methods ***/
497 static HRESULT WINAPI
IDirect3DRM2Impl_CreateObject(IDirect3DRM2
* iface
, REFCLSID rclsid
,
498 LPUNKNOWN pUnkOuter
, REFIID riid
,
501 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
503 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface
, This
, debugstr_guid(rclsid
), pUnkOuter
,
504 debugstr_guid(riid
), ppvObj
);
509 static HRESULT WINAPI
IDirect3DRM2Impl_CreateFrame(IDirect3DRM2
*iface
,
510 IDirect3DRMFrame
*parent_frame
, IDirect3DRMFrame2
**frame
)
512 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
514 TRACE("(%p/%p)->(%p,%p)\n", iface
, This
, parent_frame
, frame
);
516 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2
, (IUnknown
*)parent_frame
, (IUnknown
**)frame
);
519 static HRESULT WINAPI
IDirect3DRM2Impl_CreateMesh(IDirect3DRM2
*iface
, IDirect3DRMMesh
**mesh
)
521 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM2(iface
);
523 TRACE("iface %p, mesh %p.\n", iface
, mesh
);
525 return IDirect3DRM3_CreateMesh(&d3drm
->IDirect3DRM3_iface
, mesh
);
528 static HRESULT WINAPI
IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2
*iface
, IDirect3DRMMeshBuilder2
**mesh_builder
)
530 TRACE("iface %p, mesh_builder %p.\n", iface
, mesh_builder
);
532 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2
, (IUnknown
**)mesh_builder
);
535 static HRESULT WINAPI
IDirect3DRM2Impl_CreateFace(IDirect3DRM2
*iface
, IDirect3DRMFace
**face
)
537 TRACE("iface %p, face %p.\n", iface
, face
);
539 return Direct3DRMFace_create(&IID_IDirect3DRMFace
, (IUnknown
**)face
);
542 static HRESULT WINAPI
IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2
*iface
, IDirect3DRMAnimation
**animation
)
544 FIXME("iface %p, animation %p stub!\n", iface
, animation
);
549 static HRESULT WINAPI
IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2
*iface
, IDirect3DRMAnimationSet
**set
)
551 FIXME("iface %p, set %p stub!\n", iface
, set
);
556 static HRESULT WINAPI
IDirect3DRM2Impl_CreateTexture(IDirect3DRM2
*iface
,
557 D3DRMIMAGE
*image
, IDirect3DRMTexture2
**texture
)
559 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
561 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface
, This
, image
, texture
);
563 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2
, (IUnknown
**)texture
);
566 static HRESULT WINAPI
IDirect3DRM2Impl_CreateLight(IDirect3DRM2
*iface
,
567 D3DRMLIGHTTYPE type
, D3DCOLOR color
, IDirect3DRMLight
**light
)
569 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM2(iface
);
571 TRACE("iface %p, type %#x, color 0x%08x, light %p.\n", iface
, type
, color
, light
);
573 return IDirect3DRM3_CreateLight(&d3drm
->IDirect3DRM3_iface
, type
, color
, light
);
576 static HRESULT WINAPI
IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2
*iface
, D3DRMLIGHTTYPE type
,
577 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, IDirect3DRMLight
**light
)
579 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM2(iface
);
581 TRACE("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p.\n",
582 iface
, type
, red
, green
, blue
, light
);
584 return IDirect3DRM3_CreateLightRGB(&d3drm
->IDirect3DRM3_iface
, type
, red
, green
, blue
, light
);
587 static HRESULT WINAPI
IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2
*iface
,
588 D3DVALUE power
, IDirect3DRMMaterial
**material
)
590 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM2(iface
);
592 TRACE("iface %p, power %.8e, material %p.\n", iface
, power
, material
);
594 return IDirect3DRM3_CreateMaterial(&d3drm
->IDirect3DRM3_iface
, power
, (IDirect3DRMMaterial2
**)material
);
597 static HRESULT WINAPI
IDirect3DRM2Impl_CreateDevice(IDirect3DRM2
*iface
,
598 DWORD width
, DWORD height
, IDirect3DRMDevice2
**device
)
600 FIXME("iface %p, width %u, height %u, device %p.\n", iface
, width
, height
, device
);
602 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2
, (IUnknown
**)device
);
605 static HRESULT WINAPI
IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2
*iface
, GUID
*pGUID
,
606 IDirectDraw
*pDD
, IDirectDrawSurface
*pDDSBack
, IDirect3DRMDevice2
**ppDevice
)
608 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
610 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface
, This
, debugstr_guid(pGUID
),
611 pDD
, pDDSBack
, ppDevice
);
613 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2
, (IUnknown
**)ppDevice
);
616 static HRESULT WINAPI
IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2
*iface
,
617 IDirect3D2
*pD3D
, IDirect3DDevice2
*pD3DDev
, IDirect3DRMDevice2
**ppDevice
)
619 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
621 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface
, This
, pD3D
, pD3DDev
, ppDevice
);
623 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2
, (IUnknown
**)ppDevice
);
626 static HRESULT WINAPI
IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2
*iface
,
627 IDirectDrawClipper
*pDDClipper
, GUID
*pGUID
, int width
, int height
,
628 IDirect3DRMDevice2
**ppDevice
)
630 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
632 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface
, This
, pDDClipper
,
633 debugstr_guid(pGUID
), width
, height
, ppDevice
);
635 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2
, (IUnknown
**)ppDevice
);
638 static HRESULT WINAPI
IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2
*iface
,
639 IDirectDrawSurface
*pDDS
, IDirect3DRMTexture2
**ppTexture
)
641 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
643 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, pDDS
, ppTexture
);
648 static HRESULT WINAPI
IDirect3DRM2Impl_CreateShadow(IDirect3DRM2
*iface
, IDirect3DRMVisual
*visual
,
649 IDirect3DRMLight
*light
, D3DVALUE px
, D3DVALUE py
, D3DVALUE pz
, D3DVALUE nx
, D3DVALUE ny
, D3DVALUE nz
,
650 IDirect3DRMVisual
**shadow
)
652 FIXME("iface %p, visual %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
653 iface
, visual
, light
, px
, py
, pz
, nx
, ny
, nz
, shadow
);
658 static HRESULT WINAPI
IDirect3DRM2Impl_CreateViewport(IDirect3DRM2
*iface
, IDirect3DRMDevice
*device
,
659 IDirect3DRMFrame
*camera
, DWORD x
, DWORD y
, DWORD width
, DWORD height
, IDirect3DRMViewport
**viewport
)
661 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
662 iface
, device
, camera
, x
, y
, width
, height
, viewport
);
664 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport
, (IUnknown
**)viewport
);
667 static HRESULT WINAPI
IDirect3DRM2Impl_CreateWrap(IDirect3DRM2
*iface
, D3DRMWRAPTYPE type
, IDirect3DRMFrame
*frame
,
668 D3DVALUE ox
, D3DVALUE oy
, D3DVALUE oz
, D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
,
669 D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
, D3DVALUE ou
, D3DVALUE ov
, D3DVALUE su
, D3DVALUE sv
,
670 IDirect3DRMWrap
**wrap
)
672 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
673 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
674 iface
, type
, frame
, ox
, oy
, oz
, dx
, dy
, dz
, ux
, uy
, uz
, ou
, ov
, su
, sv
, wrap
);
679 static HRESULT WINAPI
IDirect3DRM2Impl_CreateUserVisual(IDirect3DRM2
*iface
,
680 D3DRMUSERVISUALCALLBACK cb
, void *ctx
, IDirect3DRMUserVisual
**visual
)
682 FIXME("iface %p, cb %p, ctx %p, visual %p stub!\n", iface
, cb
, ctx
, visual
);
687 static HRESULT WINAPI
IDirect3DRM2Impl_LoadTexture(IDirect3DRM2
*iface
,
688 const char *filename
, IDirect3DRMTexture2
**texture
)
690 FIXME("iface %p, filename %s, texture %p stub!\n", iface
, debugstr_a(filename
), texture
);
692 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2
, (IUnknown
**)texture
);
695 static HRESULT WINAPI
IDirect3DRM2Impl_LoadTextureFromResource(IDirect3DRM2
*iface
, HMODULE module
,
696 const char *resource_name
, const char *resource_type
, IDirect3DRMTexture2
**texture
)
698 FIXME("iface %p, resource_name %s, resource_type %s, texture %p stub!\n",
699 iface
, debugstr_a(resource_name
), debugstr_a(resource_type
), texture
);
701 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2
, (IUnknown
**)texture
);
704 static HRESULT WINAPI
IDirect3DRM2Impl_SetSearchPath(IDirect3DRM2
* iface
, LPCSTR path
)
706 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
708 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
713 static HRESULT WINAPI
IDirect3DRM2Impl_AddSearchPath(IDirect3DRM2
* iface
, LPCSTR path
)
715 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
717 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
722 static HRESULT WINAPI
IDirect3DRM2Impl_GetSearchPath(IDirect3DRM2
* iface
, DWORD
*size_return
,
725 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
727 FIXME("(%p/%p)->(%p,%s): stub\n", iface
, This
, size_return
, path_return
);
732 static HRESULT WINAPI
IDirect3DRM2Impl_SetDefaultTextureColors(IDirect3DRM2
* iface
, DWORD nb_colors
)
734 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
736 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_colors
);
741 static HRESULT WINAPI
IDirect3DRM2Impl_SetDefaultTextureShades(IDirect3DRM2
* iface
, DWORD nb_shades
)
743 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
745 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_shades
);
750 static HRESULT WINAPI
IDirect3DRM2Impl_GetDevices(IDirect3DRM2
* iface
,
751 LPDIRECT3DRMDEVICEARRAY
* ppDeviceArray
)
753 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
755 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppDeviceArray
);
760 static HRESULT WINAPI
IDirect3DRM2Impl_GetNamedObject(IDirect3DRM2
*iface
,
761 const char *name
, IDirect3DRMObject
**object
)
763 FIXME("iface %p, name %s, object %p stub!\n", iface
, debugstr_a(name
), object
);
768 static HRESULT WINAPI
IDirect3DRM2Impl_EnumerateObjects(IDirect3DRM2
* iface
, D3DRMOBJECTCALLBACK cb
,
771 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
773 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, cb
, pArg
);
778 static HRESULT WINAPI
IDirect3DRM2Impl_Load(IDirect3DRM2
*iface
, void *source
, void *object_id
, IID
**iids
,
779 DWORD iid_count
, D3DRMLOADOPTIONS flags
, D3DRMLOADCALLBACK load_cb
, void *load_ctx
,
780 D3DRMLOADTEXTURECALLBACK load_tex_cb
, void *load_tex_ctx
, IDirect3DRMFrame
*parent_frame
)
782 IDirect3DRMImpl
*d3drm
= impl_from_IDirect3DRM2(iface
);
783 IDirect3DRMFrame3
*parent_frame3
= NULL
;
784 HRESULT hr
= D3DRM_OK
;
786 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
787 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
788 iface
, source
, object_id
, iids
, iid_count
, flags
,
789 load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
792 hr
= IDirect3DRMFrame_QueryInterface(parent_frame
, &IID_IDirect3DRMFrame3
, (void **)&parent_frame3
);
794 hr
= IDirect3DRM3_Load(&d3drm
->IDirect3DRM3_iface
, source
, object_id
, iids
, iid_count
,
795 flags
, load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame3
);
797 IDirect3DRMFrame3_Release(parent_frame3
);
802 static HRESULT WINAPI
IDirect3DRM2Impl_Tick(IDirect3DRM2
* iface
, D3DVALUE tick
)
804 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
806 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, tick
);
811 static HRESULT WINAPI
IDirect3DRM2Impl_CreateProgressiveMesh(IDirect3DRM2
* iface
,
812 LPDIRECT3DRMPROGRESSIVEMESH
* ppMesh
)
814 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM2(iface
);
816 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, ppMesh
);
821 static const struct IDirect3DRM2Vtbl Direct3DRM2_Vtbl
=
823 IDirect3DRM2Impl_QueryInterface
,
824 IDirect3DRM2Impl_AddRef
,
825 IDirect3DRM2Impl_Release
,
826 IDirect3DRM2Impl_CreateObject
,
827 IDirect3DRM2Impl_CreateFrame
,
828 IDirect3DRM2Impl_CreateMesh
,
829 IDirect3DRM2Impl_CreateMeshBuilder
,
830 IDirect3DRM2Impl_CreateFace
,
831 IDirect3DRM2Impl_CreateAnimation
,
832 IDirect3DRM2Impl_CreateAnimationSet
,
833 IDirect3DRM2Impl_CreateTexture
,
834 IDirect3DRM2Impl_CreateLight
,
835 IDirect3DRM2Impl_CreateLightRGB
,
836 IDirect3DRM2Impl_CreateMaterial
,
837 IDirect3DRM2Impl_CreateDevice
,
838 IDirect3DRM2Impl_CreateDeviceFromSurface
,
839 IDirect3DRM2Impl_CreateDeviceFromD3D
,
840 IDirect3DRM2Impl_CreateDeviceFromClipper
,
841 IDirect3DRM2Impl_CreateTextureFromSurface
,
842 IDirect3DRM2Impl_CreateShadow
,
843 IDirect3DRM2Impl_CreateViewport
,
844 IDirect3DRM2Impl_CreateWrap
,
845 IDirect3DRM2Impl_CreateUserVisual
,
846 IDirect3DRM2Impl_LoadTexture
,
847 IDirect3DRM2Impl_LoadTextureFromResource
,
848 IDirect3DRM2Impl_SetSearchPath
,
849 IDirect3DRM2Impl_AddSearchPath
,
850 IDirect3DRM2Impl_GetSearchPath
,
851 IDirect3DRM2Impl_SetDefaultTextureColors
,
852 IDirect3DRM2Impl_SetDefaultTextureShades
,
853 IDirect3DRM2Impl_GetDevices
,
854 IDirect3DRM2Impl_GetNamedObject
,
855 IDirect3DRM2Impl_EnumerateObjects
,
856 IDirect3DRM2Impl_Load
,
857 IDirect3DRM2Impl_Tick
,
858 IDirect3DRM2Impl_CreateProgressiveMesh
862 /*** IUnknown methods ***/
863 static HRESULT WINAPI
IDirect3DRM3Impl_QueryInterface(IDirect3DRM3
* iface
, REFIID riid
,
866 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
867 return IDirect3DRM_QueryInterface(&This
->IDirect3DRM_iface
, riid
, ppvObject
);
870 static ULONG WINAPI
IDirect3DRM3Impl_AddRef(IDirect3DRM3
* iface
)
872 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
873 return IDirect3DRM_AddRef(&This
->IDirect3DRM_iface
);
876 static ULONG WINAPI
IDirect3DRM3Impl_Release(IDirect3DRM3
* iface
)
878 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
879 return IDirect3DRM_Release(&This
->IDirect3DRM_iface
);
882 /*** IDirect3DRM3 methods ***/
883 static HRESULT WINAPI
IDirect3DRM3Impl_CreateObject(IDirect3DRM3
* iface
, REFCLSID rclsid
,
884 LPUNKNOWN unkwn
, REFIID riid
, LPVOID
* object
)
886 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
888 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface
, This
, debugstr_guid(rclsid
), unkwn
,
889 debugstr_guid(riid
), object
);
894 static HRESULT WINAPI
IDirect3DRM3Impl_CreateFrame(IDirect3DRM3
*iface
,
895 IDirect3DRMFrame3
*parent
, IDirect3DRMFrame3
**frame
)
897 TRACE("iface %p, parent %p, frame %p.\n", iface
, parent
, frame
);
899 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3
, (IUnknown
*)parent
, (IUnknown
**)frame
);
902 static HRESULT WINAPI
IDirect3DRM3Impl_CreateMesh(IDirect3DRM3
*iface
, IDirect3DRMMesh
**mesh
)
904 TRACE("iface %p, mesh %p.\n", iface
, mesh
);
906 return Direct3DRMMesh_create(mesh
);
909 static HRESULT WINAPI
IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3
*iface
, IDirect3DRMMeshBuilder3
**mesh_builder
)
911 TRACE("iface %p, mesh_builder %p.\n", iface
, mesh_builder
);
913 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3
, (IUnknown
**)mesh_builder
);
916 static HRESULT WINAPI
IDirect3DRM3Impl_CreateFace(IDirect3DRM3
*iface
, IDirect3DRMFace2
**face
)
918 TRACE("iface %p, face %p.\n", iface
, face
);
920 return Direct3DRMFace_create(&IID_IDirect3DRMFace2
, (IUnknown
**)face
);
923 static HRESULT WINAPI
IDirect3DRM3Impl_CreateAnimation(IDirect3DRM3
*iface
, IDirect3DRMAnimation2
**animation
)
925 FIXME("iface %p, animation %p stub!\n", iface
, animation
);
930 static HRESULT WINAPI
IDirect3DRM3Impl_CreateAnimationSet(IDirect3DRM3
*iface
, IDirect3DRMAnimationSet2
**set
)
932 FIXME("iface %p, set %p stub!\n", iface
, set
);
937 static HRESULT WINAPI
IDirect3DRM3Impl_CreateTexture(IDirect3DRM3
*iface
,
938 D3DRMIMAGE
*image
, IDirect3DRMTexture3
**texture
)
940 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
942 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface
, This
, image
, texture
);
944 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3
, (IUnknown
**)texture
);
947 static HRESULT WINAPI
IDirect3DRM3Impl_CreateLight(IDirect3DRM3
*iface
,
948 D3DRMLIGHTTYPE type
, D3DCOLOR color
, IDirect3DRMLight
**light
)
952 FIXME("iface %p, type %#x, color 0x%08x, light %p partial stub!\n", iface
, type
, color
, light
);
954 if (SUCCEEDED(hr
= Direct3DRMLight_create((IUnknown
**)light
)))
956 IDirect3DRMLight_SetType(*light
, type
);
957 IDirect3DRMLight_SetColor(*light
, color
);
963 static HRESULT WINAPI
IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3
*iface
, D3DRMLIGHTTYPE type
,
964 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
, IDirect3DRMLight
**light
)
968 FIXME("iface %p, type %#x, red %.8e, green %.8e, blue %.8e, light %p partial stub!\n",
969 iface
, type
, red
, green
, blue
, light
);
971 if (SUCCEEDED(hr
= Direct3DRMLight_create((IUnknown
**)light
)))
973 IDirect3DRMLight_SetType(*light
, type
);
974 IDirect3DRMLight_SetColorRGB(*light
, red
, green
, blue
);
980 static HRESULT WINAPI
IDirect3DRM3Impl_CreateMaterial(IDirect3DRM3
*iface
,
981 D3DVALUE power
, IDirect3DRMMaterial2
**material
)
985 TRACE("iface %p, power %.8e, material %p.\n", iface
, power
, material
);
987 if (SUCCEEDED(hr
= Direct3DRMMaterial_create(material
)))
988 IDirect3DRMMaterial2_SetPower(*material
, power
);
993 static HRESULT WINAPI
IDirect3DRM3Impl_CreateDevice(IDirect3DRM3
*iface
,
994 DWORD width
, DWORD height
, IDirect3DRMDevice3
**device
)
996 FIXME("iface %p, width %u, height %u, device %p partial stub!\n", iface
, width
, height
, device
);
998 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3
, (IUnknown
**)device
);
1001 static HRESULT WINAPI
IDirect3DRM3Impl_CreateDeviceFromSurface(IDirect3DRM3
*iface
, GUID
*pGUID
,
1002 IDirectDraw
*dd
, IDirectDrawSurface
*back
, IDirect3DRMDevice3
**device
)
1004 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1006 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface
, This
, debugstr_guid(pGUID
), dd
, back
, device
);
1008 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3
, (IUnknown
**)device
);
1011 static HRESULT WINAPI
IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3
*iface
,
1012 IDirect3D2
*d3d
, IDirect3DDevice2
*d3ddev
, IDirect3DRMDevice3
**device
)
1014 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1016 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface
, This
, d3d
, d3ddev
, device
);
1018 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3
, (IUnknown
**)device
);
1021 static HRESULT WINAPI
IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3
*iface
,
1022 IDirectDrawClipper
*clipper
, GUID
*guid
, int width
, int height
,
1023 IDirect3DRMDevice3
**device
)
1025 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1027 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface
, This
, clipper
, debugstr_guid(guid
),
1028 width
, height
, device
);
1030 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3
, (IUnknown
**)device
);
1033 static HRESULT WINAPI
IDirect3DRM3Impl_CreateShadow(IDirect3DRM3
*iface
, IUnknown
*object
, IDirect3DRMLight
*light
,
1034 D3DVALUE px
, D3DVALUE py
, D3DVALUE pz
, D3DVALUE nx
, D3DVALUE ny
, D3DVALUE nz
, IDirect3DRMShadow2
**shadow
)
1036 FIXME("iface %p, object %p, light %p, px %.8e, py %.8e, pz %.8e, nx %.8e, ny %.8e, nz %.8e, shadow %p stub!\n",
1037 iface
, object
, light
, px
, py
, pz
, nx
, ny
, nz
, shadow
);
1042 static HRESULT WINAPI
IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3
*iface
,
1043 IDirectDrawSurface
*surface
, IDirect3DRMTexture3
**texture
)
1045 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1047 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, surface
, texture
);
1052 static HRESULT WINAPI
IDirect3DRM3Impl_CreateViewport(IDirect3DRM3
*iface
, IDirect3DRMDevice3
*device
,
1053 IDirect3DRMFrame3
*camera
, DWORD x
, DWORD y
, DWORD width
, DWORD height
, IDirect3DRMViewport2
**viewport
)
1055 FIXME("iface %p, device %p, camera %p, x %u, y %u, width %u, height %u, viewport %p partial stub!\n",
1056 iface
, device
, camera
, x
, y
, width
, height
, viewport
);
1058 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2
, (IUnknown
**)viewport
);
1061 static HRESULT WINAPI
IDirect3DRM3Impl_CreateWrap(IDirect3DRM3
*iface
, D3DRMWRAPTYPE type
, IDirect3DRMFrame3
*frame
,
1062 D3DVALUE ox
, D3DVALUE oy
, D3DVALUE oz
, D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
,
1063 D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
, D3DVALUE ou
, D3DVALUE ov
, D3DVALUE su
, D3DVALUE sv
,
1064 IDirect3DRMWrap
**wrap
)
1066 FIXME("iface %p, type %#x, frame %p, ox %.8e, oy %.8e, oz %.8e, dx %.8e, dy %.8e, dz %.8e, "
1067 "ux %.8e, uy %.8e, uz %.8e, ou %.8e, ov %.8e, su %.8e, sv %.8e, wrap %p stub!\n",
1068 iface
, type
, frame
, ox
, oy
, oz
, dx
, dy
, dz
, ux
, uy
, uz
, ou
, ov
, su
, sv
, wrap
);
1073 static HRESULT WINAPI
IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3
*iface
,
1074 D3DRMUSERVISUALCALLBACK cb
, void *ctx
, IDirect3DRMUserVisual
**visual
)
1076 FIXME("iface %p, cb %p, ctx %p, visual %p stub!\n", iface
, cb
, ctx
, visual
);
1081 static HRESULT WINAPI
IDirect3DRM3Impl_LoadTexture(IDirect3DRM3
*iface
,
1082 const char *filename
, IDirect3DRMTexture3
**texture
)
1084 FIXME("iface %p, filename %s, texture %p stub!\n", iface
, debugstr_a(filename
), texture
);
1086 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3
, (IUnknown
**)texture
);
1089 static HRESULT WINAPI
IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3
*iface
, HMODULE module
,
1090 const char *resource_name
, const char *resource_type
, IDirect3DRMTexture3
**texture
)
1092 FIXME("iface %p, module %p, resource_name %s, resource_type %s, texture %p stub!\n",
1093 iface
, module
, debugstr_a(resource_name
), debugstr_a(resource_type
), texture
);
1095 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3
, (IUnknown
**)texture
);
1098 static HRESULT WINAPI
IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3
* iface
, LPCSTR path
)
1100 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1102 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
1107 static HRESULT WINAPI
IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3
* iface
, LPCSTR path
)
1109 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1111 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, path
);
1116 static HRESULT WINAPI
IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3
* iface
, DWORD
* size_return
,
1119 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1121 FIXME("(%p/%p)->(%p,%s): stub\n", iface
, This
, size_return
, path_return
);
1126 static HRESULT WINAPI
IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3
* iface
, DWORD nb_colors
)
1128 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1130 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_colors
);
1135 static HRESULT WINAPI
IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3
* iface
, DWORD nb_shades
)
1137 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1139 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, nb_shades
);
1144 static HRESULT WINAPI
IDirect3DRM3Impl_GetDevices(IDirect3DRM3
* iface
,
1145 LPDIRECT3DRMDEVICEARRAY
* DeviceArray
)
1147 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1149 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, DeviceArray
);
1154 static HRESULT WINAPI
IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3
*iface
,
1155 const char *name
, IDirect3DRMObject
**object
)
1157 FIXME("iface %p, name %s, object %p stub!\n", iface
, debugstr_a(name
), object
);
1162 static HRESULT WINAPI
IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3
* iface
, D3DRMOBJECTCALLBACK cb
,
1165 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1167 FIXME("(%p/%p)->(%p,%p): stub\n", iface
, This
, cb
, arg
);
1172 static HRESULT
load_data(IDirect3DRM3
*iface
, IDirectXFileData
*data_object
, IID
**GUIDs
, DWORD nb_GUIDs
, D3DRMLOADCALLBACK LoadProc
,
1173 void *ArgLP
, D3DRMLOADTEXTURECALLBACK LoadTextureProc
, void *ArgLTP
, IDirect3DRMFrame3
*parent_frame
)
1175 HRESULT ret
= D3DRMERR_BADOBJECT
;
1179 BOOL requested
= FALSE
;
1181 hr
= IDirectXFileData_GetType(data_object
, &guid
);
1182 if (hr
!= DXFILE_OK
)
1185 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid
));
1187 /* Load object only if it is top level and requested or if it is part of another object */
1189 if (IsEqualGUID(guid
, &TID_D3DRMMesh
))
1191 TRACE("Found TID_D3DRMMesh\n");
1193 for (i
= 0; i
< nb_GUIDs
; i
++)
1194 if (IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMMeshBuilder
) ||
1195 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMMeshBuilder2
) ||
1196 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMMeshBuilder3
))
1202 if (requested
|| parent_frame
)
1204 IDirect3DRMMeshBuilder3
*meshbuilder
;
1206 TRACE("Load mesh data\n");
1208 hr
= IDirect3DRM3_CreateMeshBuilder(iface
, &meshbuilder
);
1211 hr
= load_mesh_data(meshbuilder
, data_object
, LoadTextureProc
, ArgLTP
);
1214 /* Only top level objects are notified */
1217 IDirect3DRMObject
*object
;
1219 hr
= IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder
, GUIDs
[i
], (void**)&object
);
1222 LoadProc(object
, GUIDs
[i
], ArgLP
);
1223 IDirect3DRMObject_Release(object
);
1228 IDirect3DRMFrame3_AddVisual(parent_frame
, (IUnknown
*)meshbuilder
);
1231 IDirect3DRMMeshBuilder3_Release(meshbuilder
);
1235 ERR("Cannot process mesh\n");
1238 else if (IsEqualGUID(guid
, &TID_D3DRMFrame
))
1240 TRACE("Found TID_D3DRMFrame\n");
1242 for (i
= 0; i
< nb_GUIDs
; i
++)
1243 if (IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMFrame
) ||
1244 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMFrame2
) ||
1245 IsEqualGUID(GUIDs
[i
], &IID_IDirect3DRMFrame3
))
1251 if (requested
|| parent_frame
)
1253 IDirect3DRMFrame3
*frame
;
1255 TRACE("Load frame data\n");
1257 hr
= IDirect3DRM3_CreateFrame(iface
, parent_frame
, &frame
);
1260 IDirectXFileObject
*child
;
1262 while (SUCCEEDED(hr
= IDirectXFileData_GetNextObject(data_object
, &child
)))
1264 IDirectXFileData
*data
;
1265 IDirectXFileDataReference
*reference
;
1266 IDirectXFileBinary
*binary
;
1268 hr
= IDirectXFileObject_QueryInterface(child
, &IID_IDirectXFileBinary
, (void **)&binary
);
1271 FIXME("Binary Object not supported yet\n");
1272 IDirectXFileBinary_Release(binary
);
1276 hr
= IDirectXFileObject_QueryInterface(child
, &IID_IDirectXFileData
, (void **)&data
);
1279 TRACE("Found Data Object\n");
1280 hr
= load_data(iface
, data
, GUIDs
, nb_GUIDs
, LoadProc
, ArgLP
, LoadTextureProc
, ArgLTP
, frame
);
1281 IDirectXFileData_Release(data
);
1284 hr
= IDirectXFileObject_QueryInterface(child
, &IID_IDirectXFileDataReference
, (void **)&reference
);
1287 TRACE("Found Data Object Reference\n");
1288 IDirectXFileDataReference_Resolve(reference
, &data
);
1289 hr
= load_data(iface
, data
, GUIDs
, nb_GUIDs
, LoadProc
, ArgLP
, LoadTextureProc
, ArgLTP
, frame
);
1290 IDirectXFileData_Release(data
);
1291 IDirectXFileDataReference_Release(reference
);
1296 if (hr
!= DXFILEERR_NOMOREOBJECTS
)
1298 IDirect3DRMFrame3_Release(frame
);
1303 /* Only top level objects are notified */
1306 IDirect3DRMObject
*object
;
1308 hr
= IDirect3DRMFrame3_QueryInterface(frame
, GUIDs
[i
], (void**)&object
);
1311 LoadProc(object
, GUIDs
[i
], ArgLP
);
1312 IDirect3DRMObject_Release(object
);
1315 IDirect3DRMFrame3_Release(frame
);
1319 ERR("Cannot process frame\n");
1322 else if (IsEqualGUID(guid
, &TID_D3DRMMaterial
))
1324 TRACE("Found TID_D3DRMMaterial\n");
1326 /* Cannot be requested so nothing to do */
1328 else if (IsEqualGUID(guid
, &TID_D3DRMFrameTransformMatrix
))
1330 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1332 /* Cannot be requested */
1335 D3DRMMATRIX4D matrix
;
1338 TRACE("Load Frame Transform Matrix data\n");
1340 size
= sizeof(matrix
);
1341 hr
= IDirectXFileData_GetData(data_object
, NULL
, &size
, (void**)matrix
);
1342 if ((hr
!= DXFILE_OK
) || (size
!= sizeof(matrix
)))
1345 hr
= IDirect3DRMFrame3_AddTransform(parent_frame
, D3DRMCOMBINE_REPLACE
, matrix
);
1352 FIXME("Found unknown TID %s\n", debugstr_guid(guid
));
1362 static HRESULT WINAPI
IDirect3DRM3Impl_Load(IDirect3DRM3
*iface
, void *source
, void *object_id
, IID
**iids
,
1363 DWORD iid_count
, D3DRMLOADOPTIONS flags
, D3DRMLOADCALLBACK load_cb
, void *load_ctx
,
1364 D3DRMLOADTEXTURECALLBACK load_tex_cb
, void *load_tex_ctx
, IDirect3DRMFrame3
*parent_frame
)
1366 DXFILELOADOPTIONS load_options
;
1367 LPDIRECTXFILE pDXFile
= NULL
;
1368 LPDIRECTXFILEENUMOBJECT pEnumObject
= NULL
;
1369 LPDIRECTXFILEDATA pData
= NULL
;
1374 HRESULT ret
= D3DRMERR_BADOBJECT
;
1377 TRACE("iface %p, source %p, object_id %p, iids %p, iid_count %u, flags %#x, "
1378 "load_cb %p, load_ctx %p, load_tex_cb %p, load_tex_ctx %p, parent_frame %p.\n",
1379 iface
, source
, object_id
, iids
, iid_count
, flags
,
1380 load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
1382 TRACE("Looking for GUIDs:\n");
1383 for (i
= 0; i
< iid_count
; ++i
)
1384 TRACE("- %s (%s)\n", debugstr_guid(iids
[i
]), get_IID_string(iids
[i
]));
1386 if (flags
== D3DRMLOAD_FROMMEMORY
)
1388 load_options
= DXFILELOAD_FROMMEMORY
;
1390 else if (flags
== D3DRMLOAD_FROMFILE
)
1392 load_options
= DXFILELOAD_FROMFILE
;
1393 TRACE("Loading from file %s\n", debugstr_a(source
));
1397 FIXME("Load options %#x not supported yet.\n", flags
);
1401 hr
= DirectXFileCreate(&pDXFile
);
1402 if (hr
!= DXFILE_OK
)
1405 hr
= IDirectXFile_RegisterTemplates(pDXFile
, templates
, strlen(templates
));
1406 if (hr
!= DXFILE_OK
)
1409 hr
= IDirectXFile_CreateEnumObject(pDXFile
, source
, load_options
, &pEnumObject
);
1410 if (hr
!= DXFILE_OK
)
1413 hr
= IDirectXFileEnumObject_GetNextDataObject(pEnumObject
, &pData
);
1414 if (hr
!= DXFILE_OK
)
1417 hr
= IDirectXFileData_GetType(pData
, &pGuid
);
1418 if (hr
!= DXFILE_OK
)
1421 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid
));
1423 if (!IsEqualGUID(pGuid
, &TID_DXFILEHeader
))
1425 ret
= D3DRMERR_BADFILE
;
1429 hr
= IDirectXFileData_GetData(pData
, NULL
, &size
, (void**)&pHeader
);
1430 if ((hr
!= DXFILE_OK
) || (size
!= sizeof(Header
)))
1433 TRACE("Version is %d %d %d\n", pHeader
->major
, pHeader
->minor
, pHeader
->flags
);
1435 /* Version must be 1.0.x */
1436 if ((pHeader
->major
!= 1) || (pHeader
->minor
!= 0))
1438 ret
= D3DRMERR_BADFILE
;
1442 IDirectXFileData_Release(pData
);
1447 hr
= IDirectXFileEnumObject_GetNextDataObject(pEnumObject
, &pData
);
1448 if (hr
== DXFILEERR_NOMOREOBJECTS
)
1450 TRACE("No more object\n");
1453 else if (hr
!= DXFILE_OK
)
1455 ret
= D3DRMERR_BADFILE
;
1459 ret
= load_data(iface
, pData
, iids
, iid_count
, load_cb
, load_ctx
, load_tex_cb
, load_tex_ctx
, parent_frame
);
1460 if (ret
!= D3DRM_OK
)
1463 IDirectXFileData_Release(pData
);
1471 IDirectXFileData_Release(pData
);
1473 IDirectXFileEnumObject_Release(pEnumObject
);
1475 IDirectXFile_Release(pDXFile
);
1480 static HRESULT WINAPI
IDirect3DRM3Impl_Tick(IDirect3DRM3
* iface
, D3DVALUE tick
)
1482 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1484 FIXME("(%p/%p)->(%f): stub\n", iface
, This
, tick
);
1489 static HRESULT WINAPI
IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3
* iface
,
1490 LPDIRECT3DRMPROGRESSIVEMESH Mesh
)
1492 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1494 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, Mesh
);
1499 static HRESULT WINAPI
IDirect3DRM3Impl_RegisterClient(IDirect3DRM3
* iface
, REFGUID rguid
,
1502 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1504 FIXME("(%p/%p)->(%s, %p): stub\n", iface
, This
, debugstr_guid(rguid
), id
);
1509 static HRESULT WINAPI
IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3
* iface
, REFGUID rguid
)
1511 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1513 FIXME("(%p/%p)->(%s): stub\n", iface
, This
, debugstr_guid(rguid
));
1518 static HRESULT WINAPI
IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3
*iface
,
1519 IDirect3DRMVisual
*visual
, IDirect3DRMClippedVisual
**clipped_visual
)
1521 FIXME("iface %p, visual %p, clipped_visual %p stub!\n", iface
, visual
, clipped_visual
);
1526 static HRESULT WINAPI
IDirect3DRM3Impl_SetOptions(IDirect3DRM3
* iface
, DWORD opt
)
1528 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1530 FIXME("(%p/%p)->(%d): stub\n", iface
, This
, opt
);
1535 static HRESULT WINAPI
IDirect3DRM3Impl_GetOptions(IDirect3DRM3
* iface
, LPDWORD opt
)
1537 IDirect3DRMImpl
*This
= impl_from_IDirect3DRM3(iface
);
1539 FIXME("(%p/%p)->(%p): stub\n", iface
, This
, opt
);
1544 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl
=
1546 IDirect3DRM3Impl_QueryInterface
,
1547 IDirect3DRM3Impl_AddRef
,
1548 IDirect3DRM3Impl_Release
,
1549 IDirect3DRM3Impl_CreateObject
,
1550 IDirect3DRM3Impl_CreateFrame
,
1551 IDirect3DRM3Impl_CreateMesh
,
1552 IDirect3DRM3Impl_CreateMeshBuilder
,
1553 IDirect3DRM3Impl_CreateFace
,
1554 IDirect3DRM3Impl_CreateAnimation
,
1555 IDirect3DRM3Impl_CreateAnimationSet
,
1556 IDirect3DRM3Impl_CreateTexture
,
1557 IDirect3DRM3Impl_CreateLight
,
1558 IDirect3DRM3Impl_CreateLightRGB
,
1559 IDirect3DRM3Impl_CreateMaterial
,
1560 IDirect3DRM3Impl_CreateDevice
,
1561 IDirect3DRM3Impl_CreateDeviceFromSurface
,
1562 IDirect3DRM3Impl_CreateDeviceFromD3D
,
1563 IDirect3DRM3Impl_CreateDeviceFromClipper
,
1564 IDirect3DRM3Impl_CreateTextureFromSurface
,
1565 IDirect3DRM3Impl_CreateShadow
,
1566 IDirect3DRM3Impl_CreateViewport
,
1567 IDirect3DRM3Impl_CreateWrap
,
1568 IDirect3DRM3Impl_CreateUserVisual
,
1569 IDirect3DRM3Impl_LoadTexture
,
1570 IDirect3DRM3Impl_LoadTextureFromResource
,
1571 IDirect3DRM3Impl_SetSearchPath
,
1572 IDirect3DRM3Impl_AddSearchPath
,
1573 IDirect3DRM3Impl_GetSearchPath
,
1574 IDirect3DRM3Impl_SetDefaultTextureColors
,
1575 IDirect3DRM3Impl_SetDefaultTextureShades
,
1576 IDirect3DRM3Impl_GetDevices
,
1577 IDirect3DRM3Impl_GetNamedObject
,
1578 IDirect3DRM3Impl_EnumerateObjects
,
1579 IDirect3DRM3Impl_Load
,
1580 IDirect3DRM3Impl_Tick
,
1581 IDirect3DRM3Impl_CreateProgressiveMesh
,
1582 IDirect3DRM3Impl_RegisterClient
,
1583 IDirect3DRM3Impl_UnregisterClient
,
1584 IDirect3DRM3Impl_CreateClippedVisual
,
1585 IDirect3DRM3Impl_SetOptions
,
1586 IDirect3DRM3Impl_GetOptions
1589 HRESULT WINAPI
Direct3DRMCreate(IDirect3DRM
**d3drm
)
1591 IDirect3DRMImpl
*object
;
1593 TRACE("d3drm %p.\n", d3drm
);
1595 if (!(object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
))))
1596 return E_OUTOFMEMORY
;
1598 object
->IDirect3DRM_iface
.lpVtbl
= &Direct3DRM_Vtbl
;
1599 object
->IDirect3DRM2_iface
.lpVtbl
= &Direct3DRM2_Vtbl
;
1600 object
->IDirect3DRM3_iface
.lpVtbl
= &Direct3DRM3_Vtbl
;
1603 *d3drm
= &object
->IDirect3DRM_iface
;