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, LPDIRECT3DRMFRAME parent_frame, LPDIRECT3DRMFRAME * frame)
142 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
144 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
146 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame, (IUnknown*)parent_frame, (IUnknown**)frame);
149 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
151 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
153 TRACE("(%p/%p)->(%p)\n", iface, This, ppMesh);
155 return IDirect3DRM3_CreateMesh(&This->IDirect3DRM3_iface, ppMesh);
158 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
160 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
162 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
164 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder, (IUnknown**)ppMeshBuilder);
167 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
169 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
171 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
176 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
178 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
180 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
185 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
187 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
189 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
194 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage,
195 LPDIRECT3DRMTEXTURE * ppTexture)
197 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
199 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, pImage, ppTexture);
201 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture, (IUnknown**)ppTexture);
204 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type,
205 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
207 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
209 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
211 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
214 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type,
215 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
216 LPDIRECT3DRMLIGHT* Light)
218 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
220 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
222 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
225 static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM* iface, D3DVALUE power, LPDIRECT3DRMMATERIAL * material)
227 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
229 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
231 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
234 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
236 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
238 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
240 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
243 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM *iface, GUID *pGUID,
244 IDirectDraw *pDD, IDirectDrawSurface *pDDSBack, IDirect3DRMDevice **ppDevice)
246 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
248 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), pDD,
251 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
254 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM *iface,
255 IDirect3D *pD3D, IDirect3DDevice *pD3DDev, IDirect3DRMDevice **ppDevice)
257 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
259 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
261 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
264 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM *iface,
265 IDirectDrawClipper *pDDClipper, GUID *pGUID, int width, int height,
266 IDirect3DRMDevice **ppDevice)
268 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
270 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
271 debugstr_guid(pGUID), width, height, ppDevice);
273 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
276 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM *iface,
277 IDirectDrawSurface *pDDS, IDirect3DRMTexture **ppTexture)
279 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
281 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
286 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM* iface, LPDIRECT3DRMVISUAL pVisual, LPDIRECT3DRMLIGHT pLight, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL * ppVisual)
288 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
290 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz, nx, ny, nz, ppVisual);
295 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
297 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
299 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
300 xpos, ypos, width, height, ppViewport);
302 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
305 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM* iface, D3DRMWRAPTYPE type, LPDIRECT3DRMFRAME pFrame, 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, LPDIRECT3DRMWRAP * ppWrap)
307 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
309 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type, pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
314 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
316 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
318 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
323 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
325 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
327 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
332 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
334 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
336 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
341 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(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_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
352 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
354 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
359 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
361 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
363 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
368 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
370 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
372 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
377 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
379 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
381 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
386 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
388 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
390 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
395 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
397 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
399 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
404 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
406 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
408 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
413 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM* iface, LPVOID pObjSource, LPVOID pObjID, LPIID * ppGUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc, LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
415 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
416 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
417 HRESULT hr = D3DRM_OK;
419 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
422 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
424 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
426 IDirect3DRMFrame3_Release(pParentFrame3);
431 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
433 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
435 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
440 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
442 IDirect3DRMImpl_QueryInterface,
443 IDirect3DRMImpl_AddRef,
444 IDirect3DRMImpl_Release,
445 IDirect3DRMImpl_CreateObject,
446 IDirect3DRMImpl_CreateFrame,
447 IDirect3DRMImpl_CreateMesh,
448 IDirect3DRMImpl_CreateMeshBuilder,
449 IDirect3DRMImpl_CreateFace,
450 IDirect3DRMImpl_CreateAnimation,
451 IDirect3DRMImpl_CreateAnimationSet,
452 IDirect3DRMImpl_CreateTexture,
453 IDirect3DRMImpl_CreateLight,
454 IDirect3DRMImpl_CreateLightRGB,
455 IDirect3DRMImpl_CreateMaterial,
456 IDirect3DRMImpl_CreateDevice,
457 IDirect3DRMImpl_CreateDeviceFromSurface,
458 IDirect3DRMImpl_CreateDeviceFromD3D,
459 IDirect3DRMImpl_CreateDeviceFromClipper,
460 IDirect3DRMImpl_CreateTextureFromSurface,
461 IDirect3DRMImpl_CreateShadow,
462 IDirect3DRMImpl_CreateViewport,
463 IDirect3DRMImpl_CreateWrap,
464 IDirect3DRMImpl_CreateUserVisual,
465 IDirect3DRMImpl_LoadTexture,
466 IDirect3DRMImpl_LoadTextureFromResource,
467 IDirect3DRMImpl_SetSearchPath,
468 IDirect3DRMImpl_AddSearchPath,
469 IDirect3DRMImpl_GetSearchPath,
470 IDirect3DRMImpl_SetDefaultTextureColors,
471 IDirect3DRMImpl_SetDefaultTextureShades,
472 IDirect3DRMImpl_GetDevices,
473 IDirect3DRMImpl_GetNamedObject,
474 IDirect3DRMImpl_EnumerateObjects,
475 IDirect3DRMImpl_Load,
480 /*** IUnknown methods ***/
481 static HRESULT WINAPI IDirect3DRM2Impl_QueryInterface(IDirect3DRM2* iface, REFIID riid,
484 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
485 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
488 static ULONG WINAPI IDirect3DRM2Impl_AddRef(IDirect3DRM2* iface)
490 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
491 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
494 static ULONG WINAPI IDirect3DRM2Impl_Release(IDirect3DRM2* iface)
496 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
497 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
500 /*** IDirect3DRM2 methods ***/
501 static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSID rclsid,
502 LPUNKNOWN pUnkOuter, REFIID riid,
505 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
507 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter,
508 debugstr_guid(riid), ppvObj);
513 static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface, LPDIRECT3DRMFRAME parent_frame,
514 LPDIRECT3DRMFRAME2 * frame)
516 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
518 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
520 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame);
523 static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh)
525 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
527 TRACE("(%p/%p)->(%p)\n", iface, This, ppMesh);
529 return IDirect3DRM3_CreateMesh(&This->IDirect3DRM3_iface, ppMesh);
532 static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2* iface,
533 LPDIRECT3DRMMESHBUILDER2 * ppMeshBuilder)
535 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
537 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
539 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown**)ppMeshBuilder);
542 static HRESULT WINAPI IDirect3DRM2Impl_CreateFace(IDirect3DRM2* iface, LPDIRECT3DRMFACE * ppFace)
544 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
546 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
551 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2* iface,
552 LPDIRECT3DRMANIMATION * ppAnimation)
554 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
556 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
561 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2* iface,
562 LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
564 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
566 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
571 static HRESULT WINAPI IDirect3DRM2Impl_CreateTexture(IDirect3DRM2* iface, LPD3DRMIMAGE pImage,
572 LPDIRECT3DRMTEXTURE2 * ppTexture)
574 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
576 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, pImage, ppTexture);
578 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown**)ppTexture);
581 static HRESULT WINAPI IDirect3DRM2Impl_CreateLight(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
582 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
584 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
586 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
588 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
591 static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
592 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
593 LPDIRECT3DRMLIGHT* Light)
595 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
597 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
599 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
602 static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE power,
603 LPDIRECT3DRMMATERIAL * material)
605 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
607 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
609 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
612 static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2* iface, DWORD width, DWORD height,
613 LPDIRECT3DRMDEVICE2 * ppDevice)
615 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
617 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
619 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
622 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2 *iface, GUID *pGUID,
623 IDirectDraw *pDD, IDirectDrawSurface *pDDSBack, IDirect3DRMDevice2 **ppDevice)
625 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
627 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID),
628 pDD, pDDSBack, ppDevice);
630 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
633 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2 *iface,
634 IDirect3D2 *pD3D, IDirect3DDevice2 *pD3DDev, IDirect3DRMDevice2 **ppDevice)
636 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
638 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
640 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
643 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2 *iface,
644 IDirectDrawClipper *pDDClipper, GUID *pGUID, int width, int height,
645 IDirect3DRMDevice2 **ppDevice)
647 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
649 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
650 debugstr_guid(pGUID), width, height, ppDevice);
652 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
655 static HRESULT WINAPI IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2 *iface,
656 IDirectDrawSurface *pDDS, IDirect3DRMTexture2 **ppTexture)
658 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
660 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
665 static HRESULT WINAPI IDirect3DRM2Impl_CreateShadow(IDirect3DRM2* iface, LPDIRECT3DRMVISUAL pVisual,
666 LPDIRECT3DRMLIGHT pLight,
667 D3DVALUE px, D3DVALUE py, D3DVALUE pz,
668 D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
669 LPDIRECT3DRMVISUAL * ppVisual)
671 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
673 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz,
674 nx, ny, nz, ppVisual);
679 static HRESULT WINAPI IDirect3DRM2Impl_CreateViewport(IDirect3DRM2* iface,
680 LPDIRECT3DRMDEVICE pDevice,
681 LPDIRECT3DRMFRAME pFrame,
682 DWORD xpos, DWORD ypos,
683 DWORD width, DWORD height,
684 LPDIRECT3DRMVIEWPORT * ppViewport)
686 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
688 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
689 xpos, ypos, width, height, ppViewport);
691 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
694 static HRESULT WINAPI IDirect3DRM2Impl_CreateWrap(IDirect3DRM2* iface, D3DRMWRAPTYPE type,
695 LPDIRECT3DRMFRAME pFrame,
696 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
697 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
698 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
699 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
700 D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
702 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
704 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
705 pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
710 static HRESULT WINAPI IDirect3DRM2Impl_CreateUserVisual(IDirect3DRM2* iface,
711 D3DRMUSERVISUALCALLBACK cb, LPVOID pArg,
712 LPDIRECT3DRMUSERVISUAL * ppUserVisual)
714 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
716 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
721 static HRESULT WINAPI IDirect3DRM2Impl_LoadTexture(IDirect3DRM2* iface, const char * filename,
722 LPDIRECT3DRMTEXTURE2 * ppTexture)
724 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
726 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
731 static HRESULT WINAPI IDirect3DRM2Impl_LoadTextureFromResource(IDirect3DRM2* iface, HMODULE hModule,
732 LPCSTR strName, LPCSTR strType,
733 LPDIRECT3DRMTEXTURE2 * ppTexture)
735 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
737 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, hModule, strName, strType, ppTexture);
742 static HRESULT WINAPI IDirect3DRM2Impl_SetSearchPath(IDirect3DRM2* iface, LPCSTR path)
744 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
746 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
751 static HRESULT WINAPI IDirect3DRM2Impl_AddSearchPath(IDirect3DRM2* iface, LPCSTR path)
753 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
755 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
760 static HRESULT WINAPI IDirect3DRM2Impl_GetSearchPath(IDirect3DRM2* iface, DWORD *size_return,
763 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
765 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
770 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureColors(IDirect3DRM2* iface, DWORD nb_colors)
772 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
774 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
779 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureShades(IDirect3DRM2* iface, DWORD nb_shades)
781 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
783 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
788 static HRESULT WINAPI IDirect3DRM2Impl_GetDevices(IDirect3DRM2* iface,
789 LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
791 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
793 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
798 static HRESULT WINAPI IDirect3DRM2Impl_GetNamedObject(IDirect3DRM2* iface, const char * pName,
799 LPDIRECT3DRMOBJECT * ppObject)
801 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
803 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
808 static HRESULT WINAPI IDirect3DRM2Impl_EnumerateObjects(IDirect3DRM2* iface, D3DRMOBJECTCALLBACK cb,
811 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
813 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
818 static HRESULT WINAPI IDirect3DRM2Impl_Load(IDirect3DRM2* iface, LPVOID pObjSource, LPVOID pObjID,
819 LPIID * ppGUIDs, DWORD nb_GUIDs,
820 D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc,
821 LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc,
822 LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
824 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
825 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
826 HRESULT hr = D3DRM_OK;
828 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, pObjSource, pObjID,
829 ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
832 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
834 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
836 IDirect3DRMFrame3_Release(pParentFrame3);
841 static HRESULT WINAPI IDirect3DRM2Impl_Tick(IDirect3DRM2* iface, D3DVALUE tick)
843 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
845 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
850 static HRESULT WINAPI IDirect3DRM2Impl_CreateProgressiveMesh(IDirect3DRM2* iface,
851 LPDIRECT3DRMPROGRESSIVEMESH * ppMesh)
853 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
855 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
860 static const struct IDirect3DRM2Vtbl Direct3DRM2_Vtbl =
862 IDirect3DRM2Impl_QueryInterface,
863 IDirect3DRM2Impl_AddRef,
864 IDirect3DRM2Impl_Release,
865 IDirect3DRM2Impl_CreateObject,
866 IDirect3DRM2Impl_CreateFrame,
867 IDirect3DRM2Impl_CreateMesh,
868 IDirect3DRM2Impl_CreateMeshBuilder,
869 IDirect3DRM2Impl_CreateFace,
870 IDirect3DRM2Impl_CreateAnimation,
871 IDirect3DRM2Impl_CreateAnimationSet,
872 IDirect3DRM2Impl_CreateTexture,
873 IDirect3DRM2Impl_CreateLight,
874 IDirect3DRM2Impl_CreateLightRGB,
875 IDirect3DRM2Impl_CreateMaterial,
876 IDirect3DRM2Impl_CreateDevice,
877 IDirect3DRM2Impl_CreateDeviceFromSurface,
878 IDirect3DRM2Impl_CreateDeviceFromD3D,
879 IDirect3DRM2Impl_CreateDeviceFromClipper,
880 IDirect3DRM2Impl_CreateTextureFromSurface,
881 IDirect3DRM2Impl_CreateShadow,
882 IDirect3DRM2Impl_CreateViewport,
883 IDirect3DRM2Impl_CreateWrap,
884 IDirect3DRM2Impl_CreateUserVisual,
885 IDirect3DRM2Impl_LoadTexture,
886 IDirect3DRM2Impl_LoadTextureFromResource,
887 IDirect3DRM2Impl_SetSearchPath,
888 IDirect3DRM2Impl_AddSearchPath,
889 IDirect3DRM2Impl_GetSearchPath,
890 IDirect3DRM2Impl_SetDefaultTextureColors,
891 IDirect3DRM2Impl_SetDefaultTextureShades,
892 IDirect3DRM2Impl_GetDevices,
893 IDirect3DRM2Impl_GetNamedObject,
894 IDirect3DRM2Impl_EnumerateObjects,
895 IDirect3DRM2Impl_Load,
896 IDirect3DRM2Impl_Tick,
897 IDirect3DRM2Impl_CreateProgressiveMesh
901 /*** IUnknown methods ***/
902 static HRESULT WINAPI IDirect3DRM3Impl_QueryInterface(IDirect3DRM3* iface, REFIID riid,
905 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
906 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
909 static ULONG WINAPI IDirect3DRM3Impl_AddRef(IDirect3DRM3* iface)
911 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
912 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
915 static ULONG WINAPI IDirect3DRM3Impl_Release(IDirect3DRM3* iface)
917 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
918 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
921 /*** IDirect3DRM3 methods ***/
922 static HRESULT WINAPI IDirect3DRM3Impl_CreateObject(IDirect3DRM3* iface, REFCLSID rclsid,
923 LPUNKNOWN unkwn, REFIID riid, LPVOID* object)
925 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
927 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), unkwn,
928 debugstr_guid(riid), object);
933 static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3* iface, LPDIRECT3DRMFRAME3 parent_frame,
934 LPDIRECT3DRMFRAME3* frame)
936 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
938 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
940 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown*)parent_frame, (IUnknown**)frame);
943 static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3* iface, LPDIRECT3DRMMESH* Mesh)
945 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
947 TRACE("(%p/%p)->(%p)\n", iface, This, Mesh);
949 return Direct3DRMMesh_create(Mesh);
952 static HRESULT WINAPI IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3* iface,
953 LPDIRECT3DRMMESHBUILDER3* ppMeshBuilder)
955 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
957 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
959 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3, (IUnknown**)ppMeshBuilder);
962 static HRESULT WINAPI IDirect3DRM3Impl_CreateFace(IDirect3DRM3* iface, LPDIRECT3DRMFACE2* Face)
964 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
966 FIXME("(%p/%p)->(%p): stub\n", iface, This, Face);
971 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimation(IDirect3DRM3* iface,
972 LPDIRECT3DRMANIMATION2* Animation)
974 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
976 FIXME("(%p/%p)->(%p): stub\n", iface, This, Animation);
981 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimationSet(IDirect3DRM3* iface,
982 LPDIRECT3DRMANIMATIONSET2* AnimationSet)
984 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
986 FIXME("(%p/%p)->(%p): stub\n", iface, This, AnimationSet);
991 static HRESULT WINAPI IDirect3DRM3Impl_CreateTexture(IDirect3DRM3* iface, LPD3DRMIMAGE Image,
992 LPDIRECT3DRMTEXTURE3* Texture)
994 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
996 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, Image, Texture);
998 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture3, (IUnknown**)Texture);
1001 static HRESULT WINAPI IDirect3DRM3Impl_CreateLight(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
1002 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
1004 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1007 FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, type, color, Light);
1009 ret = Direct3DRMLight_create((IUnknown**)Light);
1013 IDirect3DRMLight_SetType(*Light, type);
1014 IDirect3DRMLight_SetColor(*Light, color);
1020 static HRESULT WINAPI IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
1021 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
1022 LPDIRECT3DRMLIGHT* Light)
1024 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1027 FIXME("(%p/%p)->(%d,%f,%f,%f,%p): partial stub\n", iface, This, type, red, green, blue, Light);
1029 ret = Direct3DRMLight_create((IUnknown**)Light);
1033 IDirect3DRMLight_SetType(*Light, type);
1034 IDirect3DRMLight_SetColorRGB(*Light, red, green, blue);
1040 static HRESULT WINAPI IDirect3DRM3Impl_CreateMaterial(IDirect3DRM3* iface, D3DVALUE power,
1041 LPDIRECT3DRMMATERIAL2* material)
1043 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1046 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
1048 ret = Direct3DRMMaterial_create(material);
1051 IDirect3DRMMaterial2_SetPower(*material, power);
1056 static HRESULT WINAPI IDirect3DRM3Impl_CreateDevice(IDirect3DRM3* iface, DWORD width, DWORD height,
1057 LPDIRECT3DRMDEVICE3* device)
1059 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1061 FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, width, height, device);
1063 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1066 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromSurface(IDirect3DRM3 *iface, GUID *pGUID,
1067 IDirectDraw *dd, IDirectDrawSurface *back, IDirect3DRMDevice3 **device)
1069 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1071 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), dd, back, device);
1073 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1076 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3 *iface,
1077 IDirect3D2 *d3d, IDirect3DDevice2 *d3ddev, IDirect3DRMDevice3 **device)
1079 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1081 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, d3d, d3ddev, device);
1083 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1086 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3 *iface,
1087 IDirectDrawClipper *clipper, GUID *guid, int width, int height,
1088 IDirect3DRMDevice3 **device)
1090 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1092 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, clipper, debugstr_guid(guid),
1093 width, height, device);
1095 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1098 static HRESULT WINAPI IDirect3DRM3Impl_CreateShadow(IDirect3DRM3* iface, LPUNKNOWN Visual1,
1099 LPDIRECT3DRMLIGHT Light, D3DVALUE px,
1100 D3DVALUE py, D3DVALUE pz, D3DVALUE nx,
1101 D3DVALUE ny, D3DVALUE nz,
1102 LPDIRECT3DRMSHADOW2* Visual2)
1104 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1106 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, Visual1, Light, px, py, pz,
1107 nx, ny, nz, Visual2);
1112 static HRESULT WINAPI IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3 *iface,
1113 IDirectDrawSurface *surface, IDirect3DRMTexture3 **texture)
1115 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1117 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, surface, texture);
1122 static HRESULT WINAPI IDirect3DRM3Impl_CreateViewport(IDirect3DRM3* iface,
1123 LPDIRECT3DRMDEVICE3 Device,
1124 LPDIRECT3DRMFRAME3 frame, DWORD xpos,
1125 DWORD ypos, DWORD width, DWORD height,
1126 LPDIRECT3DRMVIEWPORT2* viewport)
1128 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1130 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, Device, frame, xpos, ypos, width,
1133 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown**)viewport);
1136 static HRESULT WINAPI IDirect3DRM3Impl_CreateWrap(IDirect3DRM3* iface, D3DRMWRAPTYPE type,
1137 LPDIRECT3DRMFRAME3 frame,
1138 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
1139 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1140 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
1141 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
1142 D3DVALUE sv, LPDIRECT3DRMWRAP* wrap)
1144 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1146 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
1147 frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
1152 static HRESULT WINAPI IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3* iface,
1153 D3DRMUSERVISUALCALLBACK cb, LPVOID arg,
1154 LPDIRECT3DRMUSERVISUAL* UserVisual)
1156 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1158 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, arg, UserVisual);
1163 static HRESULT WINAPI IDirect3DRM3Impl_LoadTexture(IDirect3DRM3* iface, const char* filename,
1164 LPDIRECT3DRMTEXTURE3* Texture)
1166 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1168 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, Texture);
1173 static HRESULT WINAPI IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3* iface, HMODULE mod,
1174 LPCSTR strName, LPCSTR strType,
1175 LPDIRECT3DRMTEXTURE3 * ppTexture)
1177 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1179 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, mod, strName, strType, ppTexture);
1184 static HRESULT WINAPI IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3* iface, LPCSTR path)
1186 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1188 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1193 static HRESULT WINAPI IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3* iface, LPCSTR path)
1195 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1197 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1202 static HRESULT WINAPI IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3* iface, DWORD* size_return,
1205 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1207 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
1212 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3* iface, DWORD nb_colors)
1214 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1216 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
1221 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3* iface, DWORD nb_shades)
1223 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1225 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
1230 static HRESULT WINAPI IDirect3DRM3Impl_GetDevices(IDirect3DRM3* iface,
1231 LPDIRECT3DRMDEVICEARRAY* DeviceArray)
1233 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1235 FIXME("(%p/%p)->(%p): stub\n", iface, This, DeviceArray);
1240 static HRESULT WINAPI IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3* iface, const char* Name,
1241 LPDIRECT3DRMOBJECT* Object)
1243 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1245 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, Name, Object);
1250 static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3DRMOBJECTCALLBACK cb,
1253 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1255 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1260 static HRESULT load_data(IDirect3DRM3 *iface, IDirectXFileData *data_object, IID **GUIDs, DWORD nb_GUIDs, D3DRMLOADCALLBACK LoadProc,
1261 void *ArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, void *ArgLTP, IDirect3DRMFrame3 *parent_frame)
1263 HRESULT ret = D3DRMERR_BADOBJECT;
1267 BOOL requested = FALSE;
1269 hr = IDirectXFileData_GetType(data_object, &guid);
1270 if (hr != DXFILE_OK)
1273 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid));
1275 /* Load object only if it is top level and requested or if it is part of another object */
1277 if (IsEqualGUID(guid, &TID_D3DRMMesh))
1279 TRACE("Found TID_D3DRMMesh\n");
1281 for (i = 0; i < nb_GUIDs; i++)
1282 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder) ||
1283 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder2) ||
1284 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder3))
1290 if (requested || parent_frame)
1292 IDirect3DRMMeshBuilder3 *meshbuilder;
1294 TRACE("Load mesh data\n");
1296 hr = IDirect3DRM3_CreateMeshBuilder(iface, &meshbuilder);
1299 hr = load_mesh_data(meshbuilder, data_object, LoadTextureProc, ArgLTP);
1302 /* Only top level objects are notified */
1305 IDirect3DRMObject *object;
1307 hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder, GUIDs[i], (void**)&object);
1310 LoadProc(object, GUIDs[i], ArgLP);
1311 IDirect3DRMObject_Release(object);
1316 IDirect3DRMFrame3_AddVisual(parent_frame, (IUnknown*)meshbuilder);
1319 IDirect3DRMMeshBuilder3_Release(meshbuilder);
1323 ERR("Cannot process mesh\n");
1326 else if (IsEqualGUID(guid, &TID_D3DRMFrame))
1328 TRACE("Found TID_D3DRMFrame\n");
1330 for (i = 0; i < nb_GUIDs; i++)
1331 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame) ||
1332 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame2) ||
1333 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame3))
1339 if (requested || parent_frame)
1341 IDirect3DRMFrame3 *frame;
1343 TRACE("Load frame data\n");
1345 hr = IDirect3DRM3_CreateFrame(iface, parent_frame, &frame);
1348 IDirectXFileObject *child;
1350 while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(data_object, &child)))
1352 IDirectXFileData *data;
1353 IDirectXFileDataReference *reference;
1354 IDirectXFileBinary *binary;
1356 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary);
1359 FIXME("Binary Object not supported yet\n");
1360 IDirectXFileBinary_Release(binary);
1364 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
1367 TRACE("Found Data Object\n");
1368 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1369 IDirectXFileData_Release(data);
1372 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
1375 TRACE("Found Data Object Reference\n");
1376 IDirectXFileDataReference_Resolve(reference, &data);
1377 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1378 IDirectXFileData_Release(data);
1379 IDirectXFileDataReference_Release(reference);
1384 if (hr != DXFILEERR_NOMOREOBJECTS)
1386 IDirect3DRMFrame3_Release(frame);
1391 /* Only top level objects are notified */
1394 IDirect3DRMObject *object;
1396 hr = IDirect3DRMFrame3_QueryInterface(frame, GUIDs[i], (void**)&object);
1399 LoadProc(object, GUIDs[i], ArgLP);
1400 IDirect3DRMObject_Release(object);
1403 IDirect3DRMFrame3_Release(frame);
1407 ERR("Cannot process frame\n");
1410 else if (IsEqualGUID(guid, &TID_D3DRMMaterial))
1412 TRACE("Found TID_D3DRMMaterial\n");
1414 /* Cannot be requested so nothing to do */
1416 else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix))
1418 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1420 /* Cannot be requested */
1423 D3DRMMATRIX4D matrix;
1426 TRACE("Load Frame Transform Matrix data\n");
1428 size = sizeof(matrix);
1429 hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix);
1430 if ((hr != DXFILE_OK) || (size != sizeof(matrix)))
1433 hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix);
1440 FIXME("Found unknown TID %s\n", debugstr_guid(guid));
1450 static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3* iface, LPVOID ObjSource, LPVOID ObjID,
1451 LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags,
1452 D3DRMLOADCALLBACK LoadProc, LPVOID ArgLP,
1453 D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP,
1454 LPDIRECT3DRMFRAME3 ParentFrame)
1456 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1457 DXFILELOADOPTIONS load_options;
1458 LPDIRECTXFILE pDXFile = NULL;
1459 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1460 LPDIRECTXFILEDATA pData = NULL;
1465 HRESULT ret = D3DRMERR_BADOBJECT;
1468 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, ObjSource, ObjID, GUIDs,
1469 nb_GUIDs, LOFlags, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1471 TRACE("Looking for GUIDs:\n");
1472 for (i = 0; i < nb_GUIDs; i++)
1473 TRACE("- %s (%s)\n", debugstr_guid(GUIDs[i]), get_IID_string(GUIDs[i]));
1475 if (LOFlags == D3DRMLOAD_FROMMEMORY)
1477 load_options = DXFILELOAD_FROMMEMORY;
1479 else if (LOFlags == D3DRMLOAD_FROMFILE)
1481 load_options = DXFILELOAD_FROMFILE;
1482 TRACE("Loading from file %s\n", debugstr_a(ObjSource));
1486 FIXME("Load options %d not supported yet\n", LOFlags);
1490 hr = DirectXFileCreate(&pDXFile);
1491 if (hr != DXFILE_OK)
1494 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1495 if (hr != DXFILE_OK)
1498 hr = IDirectXFile_CreateEnumObject(pDXFile, ObjSource, load_options, &pEnumObject);
1499 if (hr != DXFILE_OK)
1502 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1503 if (hr != DXFILE_OK)
1506 hr = IDirectXFileData_GetType(pData, &pGuid);
1507 if (hr != DXFILE_OK)
1510 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1512 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1514 ret = D3DRMERR_BADFILE;
1518 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1519 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1522 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1524 /* Version must be 1.0.x */
1525 if ((pHeader->major != 1) || (pHeader->minor != 0))
1527 ret = D3DRMERR_BADFILE;
1531 IDirectXFileData_Release(pData);
1536 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1537 if (hr == DXFILEERR_NOMOREOBJECTS)
1539 TRACE("No more object\n");
1542 else if (hr != DXFILE_OK)
1544 ret = D3DRMERR_BADFILE;
1548 ret = load_data(iface, pData, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1549 if (ret != D3DRM_OK)
1552 IDirectXFileData_Release(pData);
1560 IDirectXFileData_Release(pData);
1562 IDirectXFileEnumObject_Release(pEnumObject);
1564 IDirectXFile_Release(pDXFile);
1569 static HRESULT WINAPI IDirect3DRM3Impl_Tick(IDirect3DRM3* iface, D3DVALUE tick)
1571 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1573 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
1578 static HRESULT WINAPI IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3* iface,
1579 LPDIRECT3DRMPROGRESSIVEMESH Mesh)
1581 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1583 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
1588 static HRESULT WINAPI IDirect3DRM3Impl_RegisterClient(IDirect3DRM3* iface, REFGUID rguid,
1591 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1593 FIXME("(%p/%p)->(%s, %p): stub\n", iface, This, debugstr_guid(rguid), id);
1598 static HRESULT WINAPI IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3* iface, REFGUID rguid)
1600 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1602 FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_guid(rguid));
1607 static HRESULT WINAPI IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3* iface,
1608 LPDIRECT3DRMVISUAL vis,
1609 LPDIRECT3DRMCLIPPEDVISUAL* clippedvis)
1611 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1613 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, vis, clippedvis);
1618 static HRESULT WINAPI IDirect3DRM3Impl_SetOptions(IDirect3DRM3* iface, DWORD opt)
1620 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1622 FIXME("(%p/%p)->(%d): stub\n", iface, This, opt);
1627 static HRESULT WINAPI IDirect3DRM3Impl_GetOptions(IDirect3DRM3* iface, LPDWORD opt)
1629 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1631 FIXME("(%p/%p)->(%p): stub\n", iface, This, opt);
1636 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl =
1638 IDirect3DRM3Impl_QueryInterface,
1639 IDirect3DRM3Impl_AddRef,
1640 IDirect3DRM3Impl_Release,
1641 IDirect3DRM3Impl_CreateObject,
1642 IDirect3DRM3Impl_CreateFrame,
1643 IDirect3DRM3Impl_CreateMesh,
1644 IDirect3DRM3Impl_CreateMeshBuilder,
1645 IDirect3DRM3Impl_CreateFace,
1646 IDirect3DRM3Impl_CreateAnimation,
1647 IDirect3DRM3Impl_CreateAnimationSet,
1648 IDirect3DRM3Impl_CreateTexture,
1649 IDirect3DRM3Impl_CreateLight,
1650 IDirect3DRM3Impl_CreateLightRGB,
1651 IDirect3DRM3Impl_CreateMaterial,
1652 IDirect3DRM3Impl_CreateDevice,
1653 IDirect3DRM3Impl_CreateDeviceFromSurface,
1654 IDirect3DRM3Impl_CreateDeviceFromD3D,
1655 IDirect3DRM3Impl_CreateDeviceFromClipper,
1656 IDirect3DRM3Impl_CreateTextureFromSurface,
1657 IDirect3DRM3Impl_CreateShadow,
1658 IDirect3DRM3Impl_CreateViewport,
1659 IDirect3DRM3Impl_CreateWrap,
1660 IDirect3DRM3Impl_CreateUserVisual,
1661 IDirect3DRM3Impl_LoadTexture,
1662 IDirect3DRM3Impl_LoadTextureFromResource,
1663 IDirect3DRM3Impl_SetSearchPath,
1664 IDirect3DRM3Impl_AddSearchPath,
1665 IDirect3DRM3Impl_GetSearchPath,
1666 IDirect3DRM3Impl_SetDefaultTextureColors,
1667 IDirect3DRM3Impl_SetDefaultTextureShades,
1668 IDirect3DRM3Impl_GetDevices,
1669 IDirect3DRM3Impl_GetNamedObject,
1670 IDirect3DRM3Impl_EnumerateObjects,
1671 IDirect3DRM3Impl_Load,
1672 IDirect3DRM3Impl_Tick,
1673 IDirect3DRM3Impl_CreateProgressiveMesh,
1674 IDirect3DRM3Impl_RegisterClient,
1675 IDirect3DRM3Impl_UnregisterClient,
1676 IDirect3DRM3Impl_CreateClippedVisual,
1677 IDirect3DRM3Impl_SetOptions,
1678 IDirect3DRM3Impl_GetOptions
1681 HRESULT Direct3DRM_create(IUnknown** ppObj)
1683 IDirect3DRMImpl* object;
1685 TRACE("(%p)\n", ppObj);
1687 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
1690 ERR("Out of memory\n");
1691 return E_OUTOFMEMORY;
1694 object->IDirect3DRM_iface.lpVtbl = &Direct3DRM_Vtbl;
1695 object->IDirect3DRM2_iface.lpVtbl = &Direct3DRM2_Vtbl;
1696 object->IDirect3DRM3_iface.lpVtbl = &Direct3DRM3_Vtbl;
1699 *ppObj = (IUnknown*)&object->IDirect3DRM_iface;