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, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
245 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
247 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), pDD,
250 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
253 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
255 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
257 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
259 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
262 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
264 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
266 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
267 debugstr_guid(pGUID), width, height, ppDevice);
269 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice, (IUnknown**)ppDevice);
272 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
274 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
276 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
281 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)
283 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
285 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);
290 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
292 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
294 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): partial stub\n", iface, This, pDevice, pFrame,
295 xpos, ypos, width, height, ppViewport);
297 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport, (IUnknown**)ppViewport);
300 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)
302 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
304 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);
309 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
311 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
313 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
318 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
320 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
322 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
327 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
329 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
331 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
336 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
338 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
340 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
345 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
347 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
349 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
354 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
356 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
358 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
363 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
365 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
367 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
372 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
374 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
376 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
381 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
383 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
385 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
390 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
392 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
394 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
399 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
401 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
403 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
408 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)
410 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
411 LPDIRECT3DRMFRAME3 pParentFrame3 = NULL;
412 HRESULT hr = D3DRM_OK;
414 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);
417 hr = IDirect3DRMFrame_QueryInterface(pParentFrame, &IID_IDirect3DRMFrame3, (void**)&pParentFrame3);
419 hr = IDirect3DRM3_Load(&This->IDirect3DRM3_iface, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame3);
421 IDirect3DRMFrame3_Release(pParentFrame3);
426 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
428 IDirect3DRMImpl *This = impl_from_IDirect3DRM(iface);
430 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
435 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
437 IDirect3DRMImpl_QueryInterface,
438 IDirect3DRMImpl_AddRef,
439 IDirect3DRMImpl_Release,
440 IDirect3DRMImpl_CreateObject,
441 IDirect3DRMImpl_CreateFrame,
442 IDirect3DRMImpl_CreateMesh,
443 IDirect3DRMImpl_CreateMeshBuilder,
444 IDirect3DRMImpl_CreateFace,
445 IDirect3DRMImpl_CreateAnimation,
446 IDirect3DRMImpl_CreateAnimationSet,
447 IDirect3DRMImpl_CreateTexture,
448 IDirect3DRMImpl_CreateLight,
449 IDirect3DRMImpl_CreateLightRGB,
450 IDirect3DRMImpl_CreateMaterial,
451 IDirect3DRMImpl_CreateDevice,
452 IDirect3DRMImpl_CreateDeviceFromSurface,
453 IDirect3DRMImpl_CreateDeviceFromD3D,
454 IDirect3DRMImpl_CreateDeviceFromClipper,
455 IDirect3DRMImpl_CreateTextureFromSurface,
456 IDirect3DRMImpl_CreateShadow,
457 IDirect3DRMImpl_CreateViewport,
458 IDirect3DRMImpl_CreateWrap,
459 IDirect3DRMImpl_CreateUserVisual,
460 IDirect3DRMImpl_LoadTexture,
461 IDirect3DRMImpl_LoadTextureFromResource,
462 IDirect3DRMImpl_SetSearchPath,
463 IDirect3DRMImpl_AddSearchPath,
464 IDirect3DRMImpl_GetSearchPath,
465 IDirect3DRMImpl_SetDefaultTextureColors,
466 IDirect3DRMImpl_SetDefaultTextureShades,
467 IDirect3DRMImpl_GetDevices,
468 IDirect3DRMImpl_GetNamedObject,
469 IDirect3DRMImpl_EnumerateObjects,
470 IDirect3DRMImpl_Load,
475 /*** IUnknown methods ***/
476 static HRESULT WINAPI IDirect3DRM2Impl_QueryInterface(IDirect3DRM2* iface, REFIID riid,
479 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
480 return IDirect3DRM_QueryInterface(&This->IDirect3DRM_iface, riid, ppvObject);
483 static ULONG WINAPI IDirect3DRM2Impl_AddRef(IDirect3DRM2* iface)
485 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
486 return IDirect3DRM_AddRef(&This->IDirect3DRM_iface);
489 static ULONG WINAPI IDirect3DRM2Impl_Release(IDirect3DRM2* iface)
491 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
492 return IDirect3DRM_Release(&This->IDirect3DRM_iface);
495 /*** IDirect3DRM2 methods ***/
496 static HRESULT WINAPI IDirect3DRM2Impl_CreateObject(IDirect3DRM2* iface, REFCLSID rclsid,
497 LPUNKNOWN pUnkOuter, REFIID riid,
500 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
502 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter,
503 debugstr_guid(riid), ppvObj);
508 static HRESULT WINAPI IDirect3DRM2Impl_CreateFrame(IDirect3DRM2* iface, LPDIRECT3DRMFRAME parent_frame,
509 LPDIRECT3DRMFRAME2 * frame)
511 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
513 TRACE("(%p/%p)->(%p,%p)\n", iface, This, parent_frame, frame);
515 return Direct3DRMFrame_create(&IID_IDirect3DRMFrame2, (IUnknown*)parent_frame, (IUnknown**)frame);
518 static HRESULT WINAPI IDirect3DRM2Impl_CreateMesh(IDirect3DRM2* iface, LPDIRECT3DRMMESH * ppMesh)
520 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
522 TRACE("(%p/%p)->(%p)\n", iface, This, ppMesh);
524 return IDirect3DRM3_CreateMesh(&This->IDirect3DRM3_iface, ppMesh);
527 static HRESULT WINAPI IDirect3DRM2Impl_CreateMeshBuilder(IDirect3DRM2* iface,
528 LPDIRECT3DRMMESHBUILDER2 * ppMeshBuilder)
530 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
532 TRACE("(%p/%p)->(%p)\n", iface, This, ppMeshBuilder);
534 return Direct3DRMMeshBuilder_create(&IID_IDirect3DRMMeshBuilder2, (IUnknown**)ppMeshBuilder);
537 static HRESULT WINAPI IDirect3DRM2Impl_CreateFace(IDirect3DRM2* iface, LPDIRECT3DRMFACE * ppFace)
539 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
541 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
546 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimation(IDirect3DRM2* iface,
547 LPDIRECT3DRMANIMATION * ppAnimation)
549 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
551 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
556 static HRESULT WINAPI IDirect3DRM2Impl_CreateAnimationSet(IDirect3DRM2* iface,
557 LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
559 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
561 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
566 static HRESULT WINAPI IDirect3DRM2Impl_CreateTexture(IDirect3DRM2* iface, LPD3DRMIMAGE pImage,
567 LPDIRECT3DRMTEXTURE2 * ppTexture)
569 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
571 FIXME("(%p/%p)->(%p,%p): partial stub\n", iface, This, pImage, ppTexture);
573 return Direct3DRMTexture_create(&IID_IDirect3DRMTexture2, (IUnknown**)ppTexture);
576 static HRESULT WINAPI IDirect3DRM2Impl_CreateLight(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
577 D3DCOLOR color, LPDIRECT3DRMLIGHT* Light)
579 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
581 TRACE("(%p/%p)->(%d,%d,%p)\n", iface, This, type, color, Light);
583 return IDirect3DRM3_CreateLight(&This->IDirect3DRM3_iface, type, color, Light);
586 static HRESULT WINAPI IDirect3DRM2Impl_CreateLightRGB(IDirect3DRM2* iface, D3DRMLIGHTTYPE type,
587 D3DVALUE red, D3DVALUE green, D3DVALUE blue,
588 LPDIRECT3DRMLIGHT* Light)
590 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
592 TRACE("(%p/%p)->(%d,%f,%f,%f,%p)\n", iface, This, type, red, green, blue, Light);
594 return IDirect3DRM3_CreateLightRGB(&This->IDirect3DRM3_iface, type, red, green, blue, Light);
597 static HRESULT WINAPI IDirect3DRM2Impl_CreateMaterial(IDirect3DRM2* iface, D3DVALUE power,
598 LPDIRECT3DRMMATERIAL * material)
600 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
602 TRACE("(%p/%p)->(%f,%p)\n", iface, This, power, material);
604 return IDirect3DRM3_CreateMaterial(&This->IDirect3DRM3_iface, power, (LPDIRECT3DRMMATERIAL2*)material);
607 static HRESULT WINAPI IDirect3DRM2Impl_CreateDevice(IDirect3DRM2* iface, DWORD width, DWORD height,
608 LPDIRECT3DRMDEVICE2 * ppDevice)
610 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
612 FIXME("(%p/%p)->(%u,%u,%p): partial stub\n", iface, This, width, height, ppDevice);
614 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
617 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromSurface(IDirect3DRM2* iface, LPGUID pGUID,
619 LPDIRECTDRAWSURFACE pDDSBack,
620 LPDIRECT3DRMDEVICE2 * ppDevice)
622 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
624 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID),
625 pDD, pDDSBack, ppDevice);
627 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
630 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromD3D(IDirect3DRM2* iface, LPDIRECT3D2 pD3D,
631 LPDIRECT3DDEVICE2 pD3DDev,
632 LPDIRECT3DRMDEVICE2 * ppDevice)
634 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
636 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, pD3D, pD3DDev, ppDevice);
638 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
641 static HRESULT WINAPI IDirect3DRM2Impl_CreateDeviceFromClipper(IDirect3DRM2* iface,
642 LPDIRECTDRAWCLIPPER pDDClipper,
643 LPGUID pGUID, int width, int height,
644 LPDIRECT3DRMDEVICE2 * ppDevice)
646 IDirect3DRMImpl *This = impl_from_IDirect3DRM2(iface);
648 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, pDDClipper,
649 debugstr_guid(pGUID), width, height, ppDevice);
651 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice2, (IUnknown**)ppDevice);
654 static HRESULT WINAPI IDirect3DRM2Impl_CreateTextureFromSurface(IDirect3DRM2* iface,
655 LPDIRECTDRAWSURFACE pDDS,
656 LPDIRECT3DRMTEXTURE2 * 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, LPGUID pGUID,
1068 LPDIRECTDRAWSURFACE back,
1069 LPDIRECT3DRMDEVICE3* device)
1071 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1073 FIXME("(%p/%p)->(%s,%p,%p,%p): partial stub\n", iface, This, debugstr_guid(pGUID), dd, back, device);
1075 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1078 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromD3D(IDirect3DRM3* iface, LPDIRECT3D2 d3d,
1079 LPDIRECT3DDEVICE2 d3ddev,
1080 LPDIRECT3DRMDEVICE3* device)
1082 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1084 FIXME("(%p/%p)->(%p,%p,%p): partial stub\n", iface, This, d3d, d3ddev, device);
1086 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1089 static HRESULT WINAPI IDirect3DRM3Impl_CreateDeviceFromClipper(IDirect3DRM3* iface,
1090 LPDIRECTDRAWCLIPPER clipper,
1091 LPGUID GUID, int width, int height,
1092 LPDIRECT3DRMDEVICE3* device)
1094 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1096 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): partial stub\n", iface, This, clipper, debugstr_guid(GUID),
1097 width, height, device);
1099 return Direct3DRMDevice_create(&IID_IDirect3DRMDevice3, (IUnknown**)device);
1102 static HRESULT WINAPI IDirect3DRM3Impl_CreateShadow(IDirect3DRM3* iface, LPUNKNOWN Visual1,
1103 LPDIRECT3DRMLIGHT Light, D3DVALUE px,
1104 D3DVALUE py, D3DVALUE pz, D3DVALUE nx,
1105 D3DVALUE ny, D3DVALUE nz,
1106 LPDIRECT3DRMSHADOW2* Visual2)
1108 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1110 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, Visual1, Light, px, py, pz,
1111 nx, ny, nz, Visual2);
1116 static HRESULT WINAPI IDirect3DRM3Impl_CreateTextureFromSurface(IDirect3DRM3* iface,
1117 LPDIRECTDRAWSURFACE surface,
1118 LPDIRECT3DRMTEXTURE3* texture)
1120 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1122 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, surface, texture);
1127 static HRESULT WINAPI IDirect3DRM3Impl_CreateViewport(IDirect3DRM3* iface,
1128 LPDIRECT3DRMDEVICE3 Device,
1129 LPDIRECT3DRMFRAME3 frame, DWORD xpos,
1130 DWORD ypos, DWORD width, DWORD height,
1131 LPDIRECT3DRMVIEWPORT2* viewport)
1133 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1135 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, Device, frame, xpos, ypos, width,
1138 return Direct3DRMViewport_create(&IID_IDirect3DRMViewport2, (IUnknown**)viewport);
1141 static HRESULT WINAPI IDirect3DRM3Impl_CreateWrap(IDirect3DRM3* iface, D3DRMWRAPTYPE type,
1142 LPDIRECT3DRMFRAME3 frame,
1143 D3DVALUE ox, D3DVALUE oy, D3DVALUE oz,
1144 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1145 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz,
1146 D3DVALUE ou, D3DVALUE ov, D3DVALUE su,
1147 D3DVALUE sv, LPDIRECT3DRMWRAP* wrap)
1149 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1151 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type,
1152 frame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, wrap);
1157 static HRESULT WINAPI IDirect3DRM3Impl_CreateUserVisual(IDirect3DRM3* iface,
1158 D3DRMUSERVISUALCALLBACK cb, LPVOID arg,
1159 LPDIRECT3DRMUSERVISUAL* UserVisual)
1161 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1163 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, arg, UserVisual);
1168 static HRESULT WINAPI IDirect3DRM3Impl_LoadTexture(IDirect3DRM3* iface, const char* filename,
1169 LPDIRECT3DRMTEXTURE3* Texture)
1171 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1173 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, Texture);
1178 static HRESULT WINAPI IDirect3DRM3Impl_LoadTextureFromResource(IDirect3DRM3* iface, HMODULE mod,
1179 LPCSTR strName, LPCSTR strType,
1180 LPDIRECT3DRMTEXTURE3 * ppTexture)
1182 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1184 FIXME("(%p/%p)->(%p,%p,%p,%p): stub\n", iface, This, mod, strName, strType, ppTexture);
1189 static HRESULT WINAPI IDirect3DRM3Impl_SetSearchPath(IDirect3DRM3* iface, LPCSTR path)
1191 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1193 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1198 static HRESULT WINAPI IDirect3DRM3Impl_AddSearchPath(IDirect3DRM3* iface, LPCSTR path)
1200 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1202 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
1207 static HRESULT WINAPI IDirect3DRM3Impl_GetSearchPath(IDirect3DRM3* iface, DWORD* size_return,
1210 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1212 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
1217 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureColors(IDirect3DRM3* iface, DWORD nb_colors)
1219 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1221 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
1226 static HRESULT WINAPI IDirect3DRM3Impl_SetDefaultTextureShades(IDirect3DRM3* iface, DWORD nb_shades)
1228 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1230 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
1235 static HRESULT WINAPI IDirect3DRM3Impl_GetDevices(IDirect3DRM3* iface,
1236 LPDIRECT3DRMDEVICEARRAY* DeviceArray)
1238 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1240 FIXME("(%p/%p)->(%p): stub\n", iface, This, DeviceArray);
1245 static HRESULT WINAPI IDirect3DRM3Impl_GetNamedObject(IDirect3DRM3* iface, const char* Name,
1246 LPDIRECT3DRMOBJECT* Object)
1248 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1250 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, Name, Object);
1255 static HRESULT WINAPI IDirect3DRM3Impl_EnumerateObjects(IDirect3DRM3* iface, D3DRMOBJECTCALLBACK cb,
1258 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1260 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1265 static HRESULT load_data(IDirect3DRM3* iface, LPDIRECTXFILEDATA data_object, LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADCALLBACK LoadProc,
1266 LPVOID ArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP, LPDIRECT3DRMFRAME3 parent_frame)
1268 HRESULT ret = D3DRMERR_BADOBJECT;
1272 BOOL requested = FALSE;
1274 hr = IDirectXFileData_GetType(data_object, &guid);
1275 if (hr != DXFILE_OK)
1278 TRACE("Found object type whose GUID = %s\n", debugstr_guid(guid));
1280 if (IsEqualGUID(guid, &TID_D3DRMMesh))
1282 TRACE("Found TID_D3DRMMesh\n");
1284 for (i = 0; i < nb_GUIDs; i++)
1285 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder) ||
1286 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder2) ||
1287 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMMeshBuilder3))
1295 LPDIRECT3DRMMESHBUILDER3 meshbuilder;
1297 TRACE("Load mesh data and notify application\n");
1299 hr = IDirect3DRM3_CreateMeshBuilder(iface, &meshbuilder);
1302 LPDIRECT3DRMOBJECT object = NULL;
1304 hr = IDirect3DRMMeshBuilder3_QueryInterface(meshbuilder, GUIDs[i], (void**)&object);
1307 hr = load_mesh_data(meshbuilder, data_object);
1310 /* Only top level objects are notified */
1312 IDirect3DRMFrame3_AddVisual(parent_frame, (IUnknown*)meshbuilder);
1314 LoadProc(object, GUIDs[i], ArgLP);
1316 IDirect3DRMObject_Release(object);
1318 IDirect3DRMMeshBuilder3_Release(meshbuilder);
1322 ERR("Cannot process mesh\n");
1325 else if (IsEqualGUID(guid, &TID_D3DRMFrame))
1327 TRACE("Found TID_D3DRMFrame\n");
1329 for (i = 0; i < nb_GUIDs; i++)
1330 if (IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame) ||
1331 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame2) ||
1332 IsEqualGUID(GUIDs[i], &IID_IDirect3DRMFrame3))
1340 LPDIRECT3DRMFRAME3 frame;
1342 TRACE("Load frame data and notify application\n");
1344 hr = IDirect3DRM3_CreateFrame(iface, parent_frame, &frame);
1347 LPDIRECT3DRMOBJECT object;
1349 hr = IDirect3DRMFrame3_QueryInterface(frame, GUIDs[i], (void**)&object);
1352 LPDIRECTXFILEOBJECT child;
1354 while (SUCCEEDED(hr = IDirectXFileData_GetNextObject(data_object, &child)))
1356 LPDIRECTXFILEDATA data;
1357 LPDIRECTXFILEDATAREFERENCE reference;
1358 LPDIRECTXFILEBINARY binary;
1360 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileBinary, (void **)&binary);
1363 FIXME("Binary Object not supported yet\n");
1364 IDirectXFileBinary_Release(binary);
1368 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileData, (void **)&data);
1371 TRACE("Found Data Object\n");
1372 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1373 IDirectXFileData_Release(data);
1376 hr = IDirectXFileObject_QueryInterface(child, &IID_IDirectXFileDataReference, (void **)&reference);
1379 TRACE("Found Data Object Reference\n");
1380 IDirectXFileDataReference_Resolve(reference, &data);
1381 hr = load_data(iface, data, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, frame);
1382 IDirectXFileData_Release(data);
1383 IDirectXFileDataReference_Release(reference);
1388 if (hr != DXFILEERR_NOMOREOBJECTS)
1390 IDirect3DRMObject_Release(object);
1391 IDirect3DRMFrame3_Release(frame);
1396 /* Only top level objects are notified */
1398 LoadProc(object, GUIDs[i], ArgLP);
1399 IDirect3DRMObject_Release(object);
1401 IDirect3DRMFrame3_Release(frame);
1405 ERR("Cannot process frame\n");
1408 else if (IsEqualGUID(guid, &TID_D3DRMMaterial))
1410 TRACE("Found TID_D3DRMMaterial => Will be taken into account when a mesh will reference it\n");
1412 else if (IsEqualGUID(guid, &TID_D3DRMFrameTransformMatrix))
1414 TRACE("Found TID_D3DRMFrameTransformMatrix\n");
1418 D3DRMMATRIX4D matrix;
1421 TRACE("Load Frame Transform Matrix data\n");
1423 size = sizeof(matrix);
1424 hr = IDirectXFileData_GetData(data_object, NULL, &size, (void**)matrix);
1425 if ((hr != DXFILE_OK) || (size != sizeof(matrix)))
1428 hr = IDirect3DRMFrame3_AddTransform(parent_frame, D3DRMCOMBINE_REPLACE, matrix);
1435 FIXME("Found unknown TID %s\n", debugstr_guid(guid));
1445 static HRESULT WINAPI IDirect3DRM3Impl_Load(IDirect3DRM3* iface, LPVOID ObjSource, LPVOID ObjID,
1446 LPIID* GUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags,
1447 D3DRMLOADCALLBACK LoadProc, LPVOID ArgLP,
1448 D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID ArgLTP,
1449 LPDIRECT3DRMFRAME3 ParentFrame)
1451 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1452 DXFILELOADOPTIONS load_options;
1453 LPDIRECTXFILE pDXFile = NULL;
1454 LPDIRECTXFILEENUMOBJECT pEnumObject = NULL;
1455 LPDIRECTXFILEDATA pData = NULL;
1460 HRESULT ret = D3DRMERR_BADOBJECT;
1463 TRACE("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p)\n", iface, This, ObjSource, ObjID, GUIDs,
1464 nb_GUIDs, LOFlags, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1466 TRACE("Looking for GUIDs:\n");
1467 for (i = 0; i < nb_GUIDs; i++)
1468 TRACE("- %s (%s)\n", debugstr_guid(GUIDs[i]), get_IID_string(GUIDs[i]));
1470 if (LOFlags == D3DRMLOAD_FROMMEMORY)
1472 load_options = DXFILELOAD_FROMMEMORY;
1474 else if (LOFlags == D3DRMLOAD_FROMFILE)
1476 load_options = DXFILELOAD_FROMFILE;
1477 TRACE("Loading from file %s\n", debugstr_a(ObjSource));
1481 FIXME("Load options %d not supported yet\n", LOFlags);
1485 hr = DirectXFileCreate(&pDXFile);
1486 if (hr != DXFILE_OK)
1489 hr = IDirectXFile_RegisterTemplates(pDXFile, templates, strlen(templates));
1490 if (hr != DXFILE_OK)
1493 hr = IDirectXFile_CreateEnumObject(pDXFile, ObjSource, load_options, &pEnumObject);
1494 if (hr != DXFILE_OK)
1497 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1498 if (hr != DXFILE_OK)
1501 hr = IDirectXFileData_GetType(pData, &pGuid);
1502 if (hr != DXFILE_OK)
1505 TRACE("Found object type whose GUID = %s\n", debugstr_guid(pGuid));
1507 if (!IsEqualGUID(pGuid, &TID_DXFILEHeader))
1509 ret = D3DRMERR_BADFILE;
1513 hr = IDirectXFileData_GetData(pData, NULL, &size, (void**)&pHeader);
1514 if ((hr != DXFILE_OK) || (size != sizeof(Header)))
1517 TRACE("Version is %d %d %d\n", pHeader->major, pHeader->minor, pHeader->flags);
1519 /* Version must be 1.0.x */
1520 if ((pHeader->major != 1) || (pHeader->minor != 0))
1522 ret = D3DRMERR_BADFILE;
1526 IDirectXFileData_Release(pData);
1531 hr = IDirectXFileEnumObject_GetNextDataObject(pEnumObject, &pData);
1532 if (hr == DXFILEERR_NOMOREOBJECTS)
1534 TRACE("No more object\n");
1537 else if (hr != DXFILE_OK)
1539 ret = D3DRMERR_NOTFOUND;
1543 ret = load_data(iface, pData, GUIDs, nb_GUIDs, LoadProc, ArgLP, LoadTextureProc, ArgLTP, ParentFrame);
1544 if (ret != D3DRM_OK)
1547 IDirectXFileData_Release(pData);
1555 IDirectXFileData_Release(pData);
1557 IDirectXFileEnumObject_Release(pEnumObject);
1559 IDirectXFile_Release(pDXFile);
1564 static HRESULT WINAPI IDirect3DRM3Impl_Tick(IDirect3DRM3* iface, D3DVALUE tick)
1566 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1568 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
1573 static HRESULT WINAPI IDirect3DRM3Impl_CreateProgressiveMesh(IDirect3DRM3* iface,
1574 LPDIRECT3DRMPROGRESSIVEMESH Mesh)
1576 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1578 FIXME("(%p/%p)->(%p): stub\n", iface, This, Mesh);
1583 static HRESULT WINAPI IDirect3DRM3Impl_RegisterClient(IDirect3DRM3* iface, REFGUID rguid,
1586 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1588 FIXME("(%p/%p)->(%s, %p): stub\n", iface, This, debugstr_guid(rguid), id);
1593 static HRESULT WINAPI IDirect3DRM3Impl_UnregisterClient(IDirect3DRM3* iface, REFGUID rguid)
1595 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1597 FIXME("(%p/%p)->(%s): stub\n", iface, This, debugstr_guid(rguid));
1602 static HRESULT WINAPI IDirect3DRM3Impl_CreateClippedVisual(IDirect3DRM3* iface,
1603 LPDIRECT3DRMVISUAL vis,
1604 LPDIRECT3DRMCLIPPEDVISUAL* clippedvis)
1606 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1608 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, vis, clippedvis);
1613 static HRESULT WINAPI IDirect3DRM3Impl_SetOptions(IDirect3DRM3* iface, DWORD opt)
1615 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1617 FIXME("(%p/%p)->(%d): stub\n", iface, This, opt);
1622 static HRESULT WINAPI IDirect3DRM3Impl_GetOptions(IDirect3DRM3* iface, LPDWORD opt)
1624 IDirect3DRMImpl *This = impl_from_IDirect3DRM3(iface);
1626 FIXME("(%p/%p)->(%p): stub\n", iface, This, opt);
1631 static const struct IDirect3DRM3Vtbl Direct3DRM3_Vtbl =
1633 IDirect3DRM3Impl_QueryInterface,
1634 IDirect3DRM3Impl_AddRef,
1635 IDirect3DRM3Impl_Release,
1636 IDirect3DRM3Impl_CreateObject,
1637 IDirect3DRM3Impl_CreateFrame,
1638 IDirect3DRM3Impl_CreateMesh,
1639 IDirect3DRM3Impl_CreateMeshBuilder,
1640 IDirect3DRM3Impl_CreateFace,
1641 IDirect3DRM3Impl_CreateAnimation,
1642 IDirect3DRM3Impl_CreateAnimationSet,
1643 IDirect3DRM3Impl_CreateTexture,
1644 IDirect3DRM3Impl_CreateLight,
1645 IDirect3DRM3Impl_CreateLightRGB,
1646 IDirect3DRM3Impl_CreateMaterial,
1647 IDirect3DRM3Impl_CreateDevice,
1648 IDirect3DRM3Impl_CreateDeviceFromSurface,
1649 IDirect3DRM3Impl_CreateDeviceFromD3D,
1650 IDirect3DRM3Impl_CreateDeviceFromClipper,
1651 IDirect3DRM3Impl_CreateTextureFromSurface,
1652 IDirect3DRM3Impl_CreateShadow,
1653 IDirect3DRM3Impl_CreateViewport,
1654 IDirect3DRM3Impl_CreateWrap,
1655 IDirect3DRM3Impl_CreateUserVisual,
1656 IDirect3DRM3Impl_LoadTexture,
1657 IDirect3DRM3Impl_LoadTextureFromResource,
1658 IDirect3DRM3Impl_SetSearchPath,
1659 IDirect3DRM3Impl_AddSearchPath,
1660 IDirect3DRM3Impl_GetSearchPath,
1661 IDirect3DRM3Impl_SetDefaultTextureColors,
1662 IDirect3DRM3Impl_SetDefaultTextureShades,
1663 IDirect3DRM3Impl_GetDevices,
1664 IDirect3DRM3Impl_GetNamedObject,
1665 IDirect3DRM3Impl_EnumerateObjects,
1666 IDirect3DRM3Impl_Load,
1667 IDirect3DRM3Impl_Tick,
1668 IDirect3DRM3Impl_CreateProgressiveMesh,
1669 IDirect3DRM3Impl_RegisterClient,
1670 IDirect3DRM3Impl_UnregisterClient,
1671 IDirect3DRM3Impl_CreateClippedVisual,
1672 IDirect3DRM3Impl_SetOptions,
1673 IDirect3DRM3Impl_GetOptions
1676 HRESULT Direct3DRM_create(IUnknown** ppObj)
1678 IDirect3DRMImpl* object;
1680 TRACE("(%p)\n", ppObj);
1682 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
1685 ERR("Out of memory\n");
1686 return E_OUTOFMEMORY;
1689 object->IDirect3DRM_iface.lpVtbl = &Direct3DRM_Vtbl;
1690 object->IDirect3DRM2_iface.lpVtbl = &Direct3DRM2_Vtbl;
1691 object->IDirect3DRM3_iface.lpVtbl = &Direct3DRM3_Vtbl;
1694 *ppObj = (IUnknown*)&object->IDirect3DRM_iface;