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 FIXME("(%p/%p)->(%p): stub\n", iface, This, 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, LPDIRECT3DRMTEXTURE * ppTexture)
196 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
198 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
203 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type,
204 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
206 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
208 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
210 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
213 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type,
214 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
215 LPDIRECT3DRMLIGHT* Light)
217 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
219 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
221 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
224 static HRESULT WINAPI IDirect3DRMImpl_CreateMaterial(IDirect3DRM* iface, D3DVALUE power, LPDIRECT3DRMMATERIAL * material)
226 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
228 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
230 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
233 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
235 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
237 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
239 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
242 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
244 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
246 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), pDD,
249 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
252 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
254 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
256 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
258 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
261 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
263 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
265 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
266 debugstr_guid(pGUID), width, height, ppDevice);
268 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
271 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
273 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
275 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
280 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)
282 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
284 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);
289 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
291 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
293 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
294 xpos, ypos, width, height, ppViewport);
296 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
299 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)
301 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
303 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);
308 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
310 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
312 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
317 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
319 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
321 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
326 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
328 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
330 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
335 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
337 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
339 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
344 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
346 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
348 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
353 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
355 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
357 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
362 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
364 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
366 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
371 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
373 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
375 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
380 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
382 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
384 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
389 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
391 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
393 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
398 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
400 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
402 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
407 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)
409 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
410 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
411 HRESULT hr = D3DRM_OK;
413 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);
416 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
418 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
420 IDirect3DRMFrame3_Release(pParentFrame3);
425 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
427 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
429 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
434 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
436 IDirect3DRMImpl_QueryInterface,
437 IDirect3DRMImpl_AddRef,
438 IDirect3DRMImpl_Release,
439 IDirect3DRMImpl_CreateObject,
440 IDirect3DRMImpl_CreateFrame,
441 IDirect3DRMImpl_CreateMesh,
442 IDirect3DRMImpl_CreateMeshBuilder,
443 IDirect3DRMImpl_CreateFace,
444 IDirect3DRMImpl_CreateAnimation,
445 IDirect3DRMImpl_CreateAnimationSet,
446 IDirect3DRMImpl_CreateTexture,
447 IDirect3DRMImpl_CreateLight,
448 IDirect3DRMImpl_CreateLightRGB,
449 IDirect3DRMImpl_CreateMaterial,
450 IDirect3DRMImpl_CreateDevice,
451 IDirect3DRMImpl_CreateDeviceFromSurface,
452 IDirect3DRMImpl_CreateDeviceFromD3D,
453 IDirect3DRMImpl_CreateDeviceFromClipper,
454 IDirect3DRMImpl_CreateTextureFromSurface,
455 IDirect3DRMImpl_CreateShadow,
456 IDirect3DRMImpl_CreateViewport,
457 IDirect3DRMImpl_CreateWrap,
458 IDirect3DRMImpl_CreateUserVisual,
459 IDirect3DRMImpl_LoadTexture,
460 IDirect3DRMImpl_LoadTextureFromResource,
461 IDirect3DRMImpl_SetSearchPath,
462 IDirect3DRMImpl_AddSearchPath,
463 IDirect3DRMImpl_GetSearchPath,
464 IDirect3DRMImpl_SetDefaultTextureColors,
465 IDirect3DRMImpl_SetDefaultTextureShades,
466 IDirect3DRMImpl_GetDevices,
467 IDirect3DRMImpl_GetNamedObject,
468 IDirect3DRMImpl_EnumerateObjects,
469 IDirect3DRMImpl_Load,
474 /*** IUnknown methods ***/
475 static HRESULT WINAPI IDirect3DRM2Impl_QueryInterface(IDirect3DRM2* iface, REFIID riid,
478 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
479 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
482 static ULONG WINAPI IDirect3DRM2Impl_AddRef(IDirect3DRM2* iface)
484 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
485 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
488 static ULONG WINAPI IDirect3DRM2Impl_Release(IDirect3DRM2* iface)
490 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
491 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
494 /*** IDirect3DRM2 methods ***/
495 static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSID rclsid,
496 LPUNKNOWN pUnkOuter, REFIID riid,
499 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
501 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter,
502 debugstr_guid(riid), ppvObj);
507 static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface, LPDIRECT3DRMFRAME parent_frame,
508 LPDIRECT3DRMFRAME2 * frame)
510 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
512 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
514 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame);
517 static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh)
519 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
521 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
526 static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2* iface,
527 LPDIRECT3DRMMESHBUILDER2 * ppMeshBuilder)
529 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
531 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
533 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown**)ppMeshBuilder);
536 static HRESULT WINAPI IDirect3DRM2Impl_CreateFace(IDirect3DRM2* iface, LPDIRECT3DRMFACE * ppFace)
538 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
540 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
545 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2* iface,
546 LPDIRECT3DRMANIMATION * ppAnimation)
548 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
550 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
555 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2* iface,
556 LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
558 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
560 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
565 static HRESULT WINAPI IDirect3DRM2Impl_CreateTexture(IDirect3DRM2* iface, LPD3DRMIMAGE pImage,
566 LPDIRECT3DRMTEXTURE2 * ppTexture)
568 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
570 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
575 static HRESULT WINAPI IDirect3DRM2Impl_CreateLight(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
576 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
578 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
580 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
582 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
585 static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
586 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
587 LPDIRECT3DRMLIGHT* Light)
589 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
591 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
593 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
596 static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE power,
597 LPDIRECT3DRMMATERIAL * material)
599 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
601 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
603 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
606 static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2* iface, DWORD width, DWORD height,
607 LPDIRECT3DRMDEVICE2 * ppDevice)
609 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
611 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
613 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
616 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2* iface, LPGUID pGUID,
618 LPDIRECTDRAWSURFACE pDDSBack,
619 LPDIRECT3DRMDEVICE2 * ppDevice)
621 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
623 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID),
624 pDD, pDDSBack, ppDevice);
626 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
629 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2* iface, LPDIRECT3D2 pD3D,
630 LPDIRECT3DDEVICE2 pD3DDev,
631 LPDIRECT3DRMDEVICE2 * ppDevice)
633 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
635 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
637 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
640 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2* iface,
641 LPDIRECTDRAWCLIPPER pDDClipper,
642 LPGUID pGUID, int width, int height,
643 LPDIRECT3DRMDEVICE2 * ppDevice)
645 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
647 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
648 debugstr_guid(pGUID), width, height, ppDevice);
650 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
653 static HRESULT WINAPI IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2* iface,
654 LPDIRECTDRAWSURFACE pDDS,
655 LPDIRECT3DRMTEXTURE2 * ppTexture)
657 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
659 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
664 static HRESULT WINAPI IDirect3DRM2Impl_CreateShadow(IDirect3DRM2* iface, LPDIRECT3DRMVISUAL pVisual,
665 LPDIRECT3DRMLIGHT pLight,
666 D3DVALUE px, D3DVALUE py, D3DVALUE pz,
667 D3DVALUE nx, D3DVALUE ny, D3DVALUE nz,
668 LPDIRECT3DRMVISUAL * ppVisual)
670 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
672 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz,
673 nx, ny, nz, ppVisual);
678 static HRESULT WINAPI IDirect3DRM2Impl_CreateViewport(IDirect3DRM2* iface,
679 LPDIRECT3DRMDEVICE pDevice,
680 LPDIRECT3DRMFRAME pFrame,
681 DWORD xpos, DWORD ypos,
682 DWORD width, DWORD height,
683 LPDIRECT3DRMVIEWPORT * ppViewport)
685 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
687 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
688 xpos, ypos, width, height, ppViewport);
690 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
693 static HRESULT WINAPI IDirect3DRM2Impl_CreateWrap(IDirect3DRM2* iface, D3DRMWRAPTYPE type,
694 LPDIRECT3DRMFRAME pFrame,
695 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
696 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
697 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
698 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
699 D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
701 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
703 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
704 pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
709 static HRESULT WINAPI IDirect3DRM2Impl_CreateUserVisual(IDirect3DRM2* iface,
710 D3DRMUSERVISUALCALLBACK cb, LPVOID pArg,
711 LPDIRECT3DRMUSERVISUAL * ppUserVisual)
713 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
715 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
720 static HRESULT WINAPI IDirect3DRM2Impl_LoadTexture(IDirect3DRM2* iface, const char * filename,
721 LPDIRECT3DRMTEXTURE2 * ppTexture)
723 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
725 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
730 static HRESULT WINAPI IDirect3DRM2Impl_LoadTextureFromResource(IDirect3DRM2* iface, HMODULE hModule,
731 LPCSTR strName, LPCSTR strType,
732 LPDIRECT3DRMTEXTURE2 * ppTexture)
734 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
736 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, hModule, strName, strType, ppTexture);
741 static HRESULT WINAPI IDirect3DRM2Impl_SetSearchPath(IDirect3DRM2* iface, LPCSTR path)
743 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
745 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
750 static HRESULT WINAPI IDirect3DRM2Impl_AddSearchPath(IDirect3DRM2* iface, LPCSTR path)
752 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
754 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
759 static HRESULT WINAPI IDirect3DRM2Impl_GetSearchPath(IDirect3DRM2* iface, DWORD *size_return,
762 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
764 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
769 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureColors(IDirect3DRM2* iface, DWORD nb_colors)
771 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
773 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
778 static HRESULT WINAPI IDirect3DRM2Impl_SetDefaultTextureShades(IDirect3DRM2* iface, DWORD nb_shades)
780 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
782 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
787 static HRESULT WINAPI IDirect3DRM2Impl_GetDevices(IDirect3DRM2* iface,
788 LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
790 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
792 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
797 static HRESULT WINAPI IDirect3DRM2Impl_GetNamedObject(IDirect3DRM2* iface, const char * pName,
798 LPDIRECT3DRMOBJECT * ppObject)
800 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
802 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
807 static HRESULT WINAPI IDirect3DRM2Impl_EnumerateObjects(IDirect3DRM2* iface, D3DRMOBJECTCALLBACK cb,
810 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
812 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
817 static HRESULT WINAPI IDirect3DRM2Impl_Load(IDirect3DRM2* iface, LPVOID pObjSource, LPVOID pObjID,
818 LPIID * ppGUIDs, DWORD nb_GUIDs,
819 D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc,
820 LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc,
821 LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
823 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
824 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
825 HRESULT hr = D3DRM_OK;
827 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, pObjSource, pObjID,
828 ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
831 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
833 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
835 IDirect3DRMFrame3_Release(pParentFrame3);
840 static HRESULT WINAPI IDirect3DRM2Impl_Tick(IDirect3DRM2* iface, D3DVALUE tick)
842 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
844 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
849 static HRESULT WINAPI IDirect3DRM2Impl_CreateProgressiveMesh(IDirect3DRM2* iface,
850 LPDIRECT3DRMPROGRESSIVEMESH * ppMesh)
852 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
854 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
859 static const struct IDirect3DRM2Vtbl Direct3DRM2_Vtbl =
861 IDirect3DRM2Impl_QueryInterface,
862 IDirect3DRM2Impl_AddRef,
863 IDirect3DRM2Impl_Release,
864 IDirect3DRM2Impl_CreateObject,
865 IDirect3DRM2Impl_CreateFrame,
866 IDirect3DRM2Impl_CreateMesh,
867 IDirect3DRM2Impl_CreateMeshBuilder,
868 IDirect3DRM2Impl_CreateFace,
869 IDirect3DRM2Impl_CreateAnimation,
870 IDirect3DRM2Impl_CreateAnimationSet,
871 IDirect3DRM2Impl_CreateTexture,
872 IDirect3DRM2Impl_CreateLight,
873 IDirect3DRM2Impl_CreateLightRGB,
874 IDirect3DRM2Impl_CreateMaterial,
875 IDirect3DRM2Impl_CreateDevice,
876 IDirect3DRM2Impl_CreateDeviceFromSurface,
877 IDirect3DRM2Impl_CreateDeviceFromD3D,
878 IDirect3DRM2Impl_CreateDeviceFromClipper,
879 IDirect3DRM2Impl_CreateTextureFromSurface,
880 IDirect3DRM2Impl_CreateShadow,
881 IDirect3DRM2Impl_CreateViewport,
882 IDirect3DRM2Impl_CreateWrap,
883 IDirect3DRM2Impl_CreateUserVisual,
884 IDirect3DRM2Impl_LoadTexture,
885 IDirect3DRM2Impl_LoadTextureFromResource,
886 IDirect3DRM2Impl_SetSearchPath,
887 IDirect3DRM2Impl_AddSearchPath,
888 IDirect3DRM2Impl_GetSearchPath,
889 IDirect3DRM2Impl_SetDefaultTextureColors,
890 IDirect3DRM2Impl_SetDefaultTextureShades,
891 IDirect3DRM2Impl_GetDevices,
892 IDirect3DRM2Impl_GetNamedObject,
893 IDirect3DRM2Impl_EnumerateObjects,
894 IDirect3DRM2Impl_Load,
895 IDirect3DRM2Impl_Tick,
896 IDirect3DRM2Impl_CreateProgressiveMesh
900 /*** IUnknown methods ***/
901 static HRESULT WINAPI IDirect3DRM3Impl_QueryInterface(IDirect3DRM3* iface, REFIID riid,
904 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
905 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
908 static ULONG WINAPI IDirect3DRM3Impl_AddRef(IDirect3DRM3* iface)
910 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
911 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
914 static ULONG WINAPI IDirect3DRM3Impl_Release(IDirect3DRM3* iface)
916 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
917 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
920 /*** IDirect3DRM3 methods ***/
921 static HRESULT WINAPI IDirect3DRM3Impl_CreateObject(IDirect3DRM3* iface, REFCLSID rclsid,
922 LPUNKNOWN unkwn, REFIID riid, LPVOID* object)
924 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
926 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), unkwn,
927 debugstr_guid(riid), object);
932 static HRESULT WINAPI IDirect3DRM3Impl_CreateFrame(IDirect3DRM3* iface, LPDIRECT3DRMFRAME3 parent_frame,
933 LPDIRECT3DRMFRAME3* frame)
935 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
937 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
939 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame3, (IUnknown*)parent_frame, (IUnknown**)frame);
942 static HRESULT WINAPI IDirect3DRM3Impl_CreateMesh(IDirect3DRM3* iface, LPDIRECT3DRMMESH* Mesh)
944 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
946 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
951 static HRESULT WINAPI IDirect3DRM3Impl_CreateMeshBuilder(IDirect3DRM3* iface,
952 LPDIRECT3DRMMESHBUILDER3* ppMeshBuilder)
954 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
956 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
958 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder3, (IUnknown**)ppMeshBuilder);
961 static HRESULT WINAPI IDirect3DRM3Impl_CreateFace(IDirect3DRM3* iface, LPDIRECT3DRMFACE2* Face)
963 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
965 FIXME("(%p/%p)->(%p): stub\n", iface, This, Face);
970 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimation(IDirect3DRM3* iface,
971 LPDIRECT3DRMANIMATION2* Animation)
973 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
975 FIXME("(%p/%p)->(%p): stub\n", iface, This, Animation);
980 static HRESULT WINAPI IDirect3DRM3Impl_CreateAnimationSet(IDirect3DRM3* iface,
981 LPDIRECT3DRMANIMATIONSET2* AnimationSet)
983 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
985 FIXME("(%p/%p)->(%p): stub\n", iface, This, AnimationSet);
990 static HRESULT WINAPI IDirect3DRM3Impl_CreateTexture(IDirect3DRM3* iface, LPD3DRMIMAGE Image,
991 LPDIRECT3DRMTEXTURE3* Texture)
993 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
995 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, Image, Texture);
1000 static HRESULT WINAPI IDirect3DRM3Impl_CreateLight(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
1001 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
1003 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1006 FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, type, color, Light);
1008 ret = Direct3DRMLight_create((IUnknown**)Light);
1012 IDirect3DRMLight_SetType(*Light, type);
1013 IDirect3DRMLight_SetColor(*Light, color);
1019 static HRESULT WINAPI IDirect3DRM3Impl_CreateLightRGB(IDirect3DRM3* iface, D3DRMLIGHTTYPE type,
1020 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
1021 LPDIRECT3DRMLIGHT* Light)
1023 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1026 FIXME("(%p/%p)->(%d,%f,%f,%f,%p): partial stub\n", iface, This, type, red, green, blue, Light);
1028 ret = Direct3DRMLight_create((IUnknown**)Light);
1032 IDirect3DRMLight_SetType(*Light, type);
1033 IDirect3DRMLight_SetColorRGB(*Light, red, green, blue);
1039 static HRESULT WINAPI IDirect3DRM3Impl_CreateMaterial(IDirect3DRM3* iface, D3DVALUE power,
1040 LPDIRECT3DRMMATERIAL2* material)
1042 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1045 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
1047 ret = Direct3DRMMaterial_create(material);
1050 IDirect3DRMMaterial2_SetPower(*material, power);
1055 static HRESULT WINAPI IDirect3DRM3Impl_CreateDevice(IDirect3DRM3* iface, DWORD width, DWORD height,
1056 LPDIRECT3DRMDEVICE3* device)
1058 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1060 FIXME("(%p/%p)->(%d,%d,%p): partial stub\n", iface, This, width, height, device);
1062 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1065 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromSurface(IDirect3DRM3* iface, LPGUID pGUID,
1067 LPDIRECTDRAWSURFACE back,
1068 LPDIRECT3DRMDEVICE3* device)
1070 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1072 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), dd, back, device);
1074 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1077 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3* iface, LPDIRECT3D2 d3d,
1078 LPDIRECT3DDEVICE2 d3ddev,
1079 LPDIRECT3DRMDEVICE3* device)
1081 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1083 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, d3d, d3ddev, device);
1085 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1088 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3* iface,
1089 LPDIRECTDRAWCLIPPER clipper,
1090 LPGUID GUID, int width, int height,
1091 LPDIRECT3DRMDEVICE3* device)
1093 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1095 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, clipper, debugstr_guid(GUID),
1096 width, height, device);
1098 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1101 static HRESULT WINAPI IDirect3DRM3Impl_CreateShadow(IDirect3DRM3* iface, LPUNKNOWN Visual1,
1102 LPDIRECT3DRMLIGHT Light, D3DVALUE px,
1103 D3DVALUE py, D3DVALUE pz, D3DVALUE nx,
1104 D3DVALUE ny, D3DVALUE nz,
1105 LPDIRECT3DRMSHADOW2* Visual2)
1107 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1109 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, Visual1, Light, px, py, pz,
1110 nx, ny, nz, Visual2);
1115 static HRESULT WINAPI IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3* iface,
1116 LPDIRECTDRAWSURFACE surface,
1117 LPDIRECT3DRMTEXTURE3* texture)
1119 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1121 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, surface, texture);
1126 static HRESULT WINAPI IDirect3DRM3Impl_CreateViewport(IDirect3DRM3* iface,
1127 LPDIRECT3DRMDEVICE3 Device,
1128 LPDIRECT3DRMFRAME3 frame, DWORD xpos,
1129 DWORD ypos, DWORD width, DWORD height,
1130 LPDIRECT3DRMVIEWPORT2* viewport)
1132 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1134 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, Device, frame, xpos, ypos, width,
1137 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown**)viewport);
1140 static HRESULT WINAPI IDirect3DRM3Impl_CreateWrap(IDirect3DRM3* iface, D3DRMWRAPTYPE type,
1141 LPDIRECT3DRMFRAME3 frame,
1142 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
1143 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1144 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
1145 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
1146 D3DVALUE sv, LPDIRECT3DRMWRAP* wrap)
1148 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1150 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
1151 frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
1156 static HRESULT WINAPI IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3* iface,
1157 D3DRMUSERVISUALCALLBACK cb, LPVOID arg,
1158 LPDIRECT3DRMUSERVISUAL* UserVisual)
1160 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1162 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, arg, UserVisual);
1167 static HRESULT WINAPI IDirect3DRM3Impl_LoadTexture(IDirect3DRM3* iface, const char* filename,
1168 LPDIRECT3DRMTEXTURE3* Texture)
1170 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1172 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, Texture);
1177 static HRESULT WINAPI IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3* iface, HMODULE mod,
1178 LPCSTR strName, LPCSTR strType,
1179 LPDIRECT3DRMTEXTURE3 * ppTexture)
1181 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1183 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, mod, strName, strType, ppTexture);
1188 static HRESULT WINAPI IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3* iface, LPCSTR path)
1190 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1192 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1197 static HRESULT WINAPI IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3* iface, LPCSTR path)
1199 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1201 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1206 static HRESULT WINAPI IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3* iface, DWORD* size_return,
1209 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1211 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
1216 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3* iface, DWORD nb_colors)
1218 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1220 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
1225 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3* iface, DWORD nb_shades)
1227 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1229 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
1234 static HRESULT WINAPI IDirect3DRM3Impl_GetDevices(IDirect3DRM3* iface,
1235 LPDIRECT3DRMDEVICEARRAY* DeviceArray)
1237 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1239 FIXME("(%p/%p)->(%p): stub\n", iface, This, DeviceArray);
1244 static HRESULT WINAPI IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3* iface, const char* Name,
1245 LPDIRECT3DRMOBJECT* Object)
1247 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1249 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, Name, Object);
1254 static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3DRMOBJECTCALLBACK cb,
1257 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1259 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1264 static HRESULT load_data(IDirect3DRM3* iface, LPDIRECTXFILEDATA data_object, LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADCALLBACK LoadProc,
1265 LPVOID ArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP, LPDIRECT3DRMFRAME3 parent_frame)
1267 HRESULT ret = D3DRMERR_BADOBJECT;
1271 BOOL requested = FALSE;
1273 hr = IDirectXFileData_GetType(data_object, &guid);
1274 if (hr != DXFILE_OK)
1277 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid));
1279 if (IsEqualGUID(guid, &TID_D3DRMMesh))
1281 TRACE("Found TID_D3DRMMesh\n");
1283 for (i = 0; i < nb_GUIDs; i++)
1284 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder) ||
1285 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder2) ||
1286 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder3))
1294 LPDIRECT3DRMMESHBUILDER3 meshbuilder;
1296 TRACE("Load mesh data and notify application\n");
1298 hr = IDirect3DRM3_CreateMeshBuilder(iface, &meshbuilder);
1301 LPDIRECT3DRMOBJECT object = NULL;
1303 hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder, GUIDs[i], (void**)&object);
1306 hr = load_mesh_data(meshbuilder, data_object);
1309 /* Only top level objects are notified */
1311 IDirect3DRMFrame3_AddVisual(parent_frame, (IUnknown*)meshbuilder);
1313 LoadProc(object, GUIDs[i], ArgLP);
1315 IDirect3DRMObject_Release(object);
1317 IDirect3DRMMeshBuilder3_Release(meshbuilder);
1321 ERR("Cannot process mesh\n");
1324 else if (IsEqualGUID(guid, &TID_D3DRMFrame))
1326 TRACE("Found TID_D3DRMFrame\n");
1328 for (i = 0; i < nb_GUIDs; i++)
1329 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame) ||
1330 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame2) ||
1331 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame3))
1339 LPDIRECT3DRMFRAME3 frame;
1341 TRACE("Load frame data and notify application\n");
1343 hr = IDirect3DRM3_CreateFrame(iface, parent_frame, &frame);
1346 LPDIRECT3DRMOBJECT object;
1348 hr = IDirect3DRMFrame3_QueryInterface(frame, GUIDs[i], (void**)&object);
1351 LPDIRECTXFILEOBJECT child;
1353 while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(data_object, &child)))
1355 LPDIRECTXFILEDATA data;
1356 LPDIRECTXFILEDATAREFERENCE reference;
1357 LPDIRECTXFILEBINARY binary;
1359 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary);
1362 FIXME("Binary Object not supported yet\n");
1363 IDirectXFileBinary_Release(binary);
1367 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
1370 TRACE("Found Data Object\n");
1371 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1372 IDirectXFileData_Release(data);
1375 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
1378 TRACE("Found Data Object Reference\n");
1379 IDirectXFileDataReference_Resolve(reference, &data);
1380 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1381 IDirectXFileData_Release(data);
1382 IDirectXFileDataReference_Release(reference);
1387 if (hr != DXFILEERR_NOMOREOBJECTS)
1389 IDirect3DRMObject_Release(object);
1390 IDirect3DRMFrame3_Release(frame);
1395 /* Only top level objects are notified */
1397 LoadProc(object, GUIDs[i], ArgLP);
1398 IDirect3DRMObject_Release(object);
1400 IDirect3DRMFrame3_Release(frame);
1404 ERR("Cannot process frame\n");
1407 else if (IsEqualGUID(guid, &TID_D3DRMMaterial))
1409 TRACE("Found TID_D3DRMMaterial => Will be taken into account when a mesh will reference it\n");
1411 else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix))
1413 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1417 D3DRMMATRIX4D matrix;
1420 TRACE("Load Frame Transform Matrix data\n");
1422 size = sizeof(matrix);
1423 hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix);
1424 if ((hr != DXFILE_OK) || (size != sizeof(matrix)))
1427 hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix);
1434 FIXME("Found unknown TID %s\n", debugstr_guid(guid));
1444 static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3* iface, LPVOID ObjSource, LPVOID ObjID,
1445 LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags,
1446 D3DRMLOADCALLBACK LoadProc, LPVOID ArgLP,
1447 D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP,
1448 LPDIRECT3DRMFRAME3 ParentFrame)
1450 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1451 DXFILELOADOPTIONS load_options;
1452 LPDIRECTXFILE pDXFile = NULL;
1453 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1454 LPDIRECTXFILEDATA pData = NULL;
1459 HRESULT ret = D3DRMERR_BADOBJECT;
1462 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, ObjSource, ObjID, GUIDs,
1463 nb_GUIDs, LOFlags, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1465 TRACE("Looking for GUIDs:\n");
1466 for (i = 0; i < nb_GUIDs; i++)
1467 TRACE("- %s (%s)\n", debugstr_guid(GUIDs[i]), get_IID_string(GUIDs[i]));
1469 if (LOFlags == D3DRMLOAD_FROMMEMORY)
1471 load_options = DXFILELOAD_FROMMEMORY;
1473 else if (LOFlags == D3DRMLOAD_FROMFILE)
1475 load_options = DXFILELOAD_FROMFILE;
1476 TRACE("Loading from file %s\n", debugstr_a(ObjSource));
1480 FIXME("Load options %d not supported yet\n", LOFlags);
1484 hr = DirectXFileCreate(&pDXFile);
1485 if (hr != DXFILE_OK)
1488 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1489 if (hr != DXFILE_OK)
1492 hr = IDirectXFile_CreateEnumObject(pDXFile, ObjSource, load_options, &pEnumObject);
1493 if (hr != DXFILE_OK)
1496 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1497 if (hr != DXFILE_OK)
1500 hr = IDirectXFileData_GetType(pData, &pGuid);
1501 if (hr != DXFILE_OK)
1504 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1506 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1508 ret = D3DRMERR_BADFILE;
1512 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1513 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1516 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1518 /* Version must be 1.0.x */
1519 if ((pHeader->major != 1) || (pHeader->minor != 0))
1521 ret = D3DRMERR_BADFILE;
1525 IDirectXFileData_Release(pData);
1530 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1531 if (hr == DXFILEERR_NOMOREOBJECTS)
1533 TRACE("No more object\n");
1536 else if (hr != DXFILE_OK)
1538 ret = D3DRMERR_NOTFOUND;
1542 ret = load_data(iface, pData, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1543 if (ret != D3DRM_OK)
1546 IDirectXFileData_Release(pData);
1554 IDirectXFileData_Release(pData);
1556 IDirectXFileEnumObject_Release(pEnumObject);
1558 IDirectXFile_Release(pDXFile);
1563 static HRESULT WINAPI IDirect3DRM3Impl_Tick(IDirect3DRM3* iface, D3DVALUE tick)
1565 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1567 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
1572 static HRESULT WINAPI IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3* iface,
1573 LPDIRECT3DRMPROGRESSIVEMESH Mesh)
1575 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1577 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
1582 static HRESULT WINAPI IDirect3DRM3Impl_RegisterClient(IDirect3DRM3* iface, REFGUID rguid,
1585 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1587 FIXME("(%p/%p)->(%s, %p): stub\n", iface, This, debugstr_guid(rguid), id);
1592 static HRESULT WINAPI IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3* iface, REFGUID rguid)
1594 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1596 FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_guid(rguid));
1601 static HRESULT WINAPI IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3* iface,
1602 LPDIRECT3DRMVISUAL vis,
1603 LPDIRECT3DRMCLIPPEDVISUAL* clippedvis)
1605 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1607 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, vis, clippedvis);
1612 static HRESULT WINAPI IDirect3DRM3Impl_SetOptions(IDirect3DRM3* iface, DWORD opt)
1614 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1616 FIXME("(%p/%p)->(%d): stub\n", iface, This, opt);
1621 static HRESULT WINAPI IDirect3DRM3Impl_GetOptions(IDirect3DRM3* iface, LPDWORD opt)
1623 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1625 FIXME("(%p/%p)->(%p): stub\n", iface, This, opt);
1630 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl =
1632 IDirect3DRM3Impl_QueryInterface,
1633 IDirect3DRM3Impl_AddRef,
1634 IDirect3DRM3Impl_Release,
1635 IDirect3DRM3Impl_CreateObject,
1636 IDirect3DRM3Impl_CreateFrame,
1637 IDirect3DRM3Impl_CreateMesh,
1638 IDirect3DRM3Impl_CreateMeshBuilder,
1639 IDirect3DRM3Impl_CreateFace,
1640 IDirect3DRM3Impl_CreateAnimation,
1641 IDirect3DRM3Impl_CreateAnimationSet,
1642 IDirect3DRM3Impl_CreateTexture,
1643 IDirect3DRM3Impl_CreateLight,
1644 IDirect3DRM3Impl_CreateLightRGB,
1645 IDirect3DRM3Impl_CreateMaterial,
1646 IDirect3DRM3Impl_CreateDevice,
1647 IDirect3DRM3Impl_CreateDeviceFromSurface,
1648 IDirect3DRM3Impl_CreateDeviceFromD3D,
1649 IDirect3DRM3Impl_CreateDeviceFromClipper,
1650 IDirect3DRM3Impl_CreateTextureFromSurface,
1651 IDirect3DRM3Impl_CreateShadow,
1652 IDirect3DRM3Impl_CreateViewport,
1653 IDirect3DRM3Impl_CreateWrap,
1654 IDirect3DRM3Impl_CreateUserVisual,
1655 IDirect3DRM3Impl_LoadTexture,
1656 IDirect3DRM3Impl_LoadTextureFromResource,
1657 IDirect3DRM3Impl_SetSearchPath,
1658 IDirect3DRM3Impl_AddSearchPath,
1659 IDirect3DRM3Impl_GetSearchPath,
1660 IDirect3DRM3Impl_SetDefaultTextureColors,
1661 IDirect3DRM3Impl_SetDefaultTextureShades,
1662 IDirect3DRM3Impl_GetDevices,
1663 IDirect3DRM3Impl_GetNamedObject,
1664 IDirect3DRM3Impl_EnumerateObjects,
1665 IDirect3DRM3Impl_Load,
1666 IDirect3DRM3Impl_Tick,
1667 IDirect3DRM3Impl_CreateProgressiveMesh,
1668 IDirect3DRM3Impl_RegisterClient,
1669 IDirect3DRM3Impl_UnregisterClient,
1670 IDirect3DRM3Impl_CreateClippedVisual,
1671 IDirect3DRM3Impl_SetOptions,
1672 IDirect3DRM3Impl_GetOptions
1675 HRESULT Direct3DRM_create(IUnknown** ppObj)
1677 IDirect3DRMImpl* object;
1679 TRACE("(%p)\n", ppObj);
1681 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
1684 ERR("Out of memory\n");
1685 return E_OUTOFMEMORY;
1688 object->IDirect3DRM_iface.lpVtbl = &Direct3DRM_Vtbl;
1689 object->IDirect3DRM2_iface.lpVtbl = &Direct3DRM2_Vtbl;
1690 object->IDirect3DRM3_iface.lpVtbl = &Direct3DRM3_Vtbl;
1693 *ppObj = (IUnknown*)&object->IDirect3DRM_iface;