d3drm: Introduce impl_from_IDirect3DRMVisualArray().
[wine.git] / dlls / d3drm / frame.c
blob7523eab3886e23f37bb1b0c181220829b7e7146e
1 /*
2 * Implementation of IDirect3DRMFrame Interface
4 * Copyright 2011, 2012 André Hentschel
5 * Copyright 2012 Christian Costa
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 <assert.h>
23 #include "wine/debug.h"
25 #define COBJMACROS
27 #include "winbase.h"
28 #include "wingdi.h"
30 #include "d3drm_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
34 static D3DRMMATRIX4D identity = {
35 { 1.0f, 0.0f, 0.0f, 0.0f },
36 { 0.0f, 1.0f, 0.0f, 0.0f },
37 { 0.0f, 0.0f, 1.0f, 0.0f },
38 { 0.0f, 0.0f, 0.0f, 1.0f }
41 typedef struct IDirect3DRMFrameImpl IDirect3DRMFrameImpl;
43 struct IDirect3DRMFrameImpl {
44 IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
45 IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
46 LONG ref;
47 IDirect3DRMFrameImpl* parent;
48 ULONG nb_children;
49 ULONG children_capacity;
50 IDirect3DRMFrame3** children;
51 ULONG nb_visuals;
52 ULONG visuals_capacity;
53 IDirect3DRMVisual** visuals;
54 ULONG nb_lights;
55 ULONG lights_capacity;
56 IDirect3DRMLight** lights;
57 D3DRMMATRIX4D transform;
58 D3DCOLOR scenebackground;
61 typedef struct {
62 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface;
63 LONG ref;
64 ULONG size;
65 IDirect3DRMFrame **frames;
66 } IDirect3DRMFrameArrayImpl;
68 typedef struct {
69 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface;
70 LONG ref;
71 ULONG size;
72 IDirect3DRMVisual **visuals;
73 } IDirect3DRMVisualArrayImpl;
75 struct d3drm_light_array
77 IDirect3DRMLightArray IDirect3DRMLightArray_iface;
78 LONG ref;
79 ULONG size;
80 IDirect3DRMLight **lights;
83 static inline IDirect3DRMFrameImpl *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
85 return CONTAINING_RECORD(iface, IDirect3DRMFrameImpl, IDirect3DRMFrame2_iface);
88 static inline IDirect3DRMFrameImpl *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
90 return CONTAINING_RECORD(iface, IDirect3DRMFrameImpl, IDirect3DRMFrame3_iface);
93 static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
95 static inline IDirect3DRMVisualArrayImpl *impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray *iface)
97 return CONTAINING_RECORD(iface, IDirect3DRMVisualArrayImpl, IDirect3DRMVisualArray_iface);
100 static inline struct d3drm_light_array *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface)
102 return CONTAINING_RECORD(iface, struct d3drm_light_array, IDirect3DRMLightArray_iface);
105 /*** IUnknown methods ***/
106 static HRESULT WINAPI IDirect3DRMFrameArrayImpl_QueryInterface(IDirect3DRMFrameArray* iface,
107 REFIID riid, void** object)
109 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
111 TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
113 *object = NULL;
115 if (IsEqualGUID(riid, &IID_IUnknown) ||
116 IsEqualGUID(riid, &IID_IDirect3DRMFrameArray))
118 *object = &This->IDirect3DRMFrameArray_iface;
120 else
122 FIXME("interface %s not implemented\n", debugstr_guid(riid));
123 return E_NOINTERFACE;
126 IDirect3DRMFrameArray_AddRef(iface);
127 return S_OK;
130 static ULONG WINAPI IDirect3DRMFrameArrayImpl_AddRef(IDirect3DRMFrameArray* iface)
132 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
133 ULONG ref = InterlockedIncrement(&This->ref);
135 TRACE("(%p)->(): new ref = %u\n", This, ref);
137 return ref;
140 static ULONG WINAPI IDirect3DRMFrameArrayImpl_Release(IDirect3DRMFrameArray* iface)
142 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
143 ULONG ref = InterlockedDecrement(&This->ref);
144 ULONG i;
146 TRACE("(%p)->(): new ref = %u\n", This, ref);
148 if (!ref)
150 for (i = 0; i < This->size; i++)
151 IDirect3DRMFrame_Release(This->frames[i]);
152 HeapFree(GetProcessHeap(), 0, This->frames);
153 HeapFree(GetProcessHeap(), 0, This);
156 return ref;
159 /*** IDirect3DRMArray methods ***/
160 static DWORD WINAPI IDirect3DRMFrameArrayImpl_GetSize(IDirect3DRMFrameArray* iface)
162 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
164 TRACE("(%p)->() = %d\n", This, This->size);
166 return This->size;
169 /*** IDirect3DRMFrameArray methods ***/
170 static HRESULT WINAPI IDirect3DRMFrameArrayImpl_GetElement(IDirect3DRMFrameArray *iface,
171 DWORD index, IDirect3DRMFrame **frame)
173 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
175 TRACE("(%p)->(%u, %p)\n", This, index, frame);
177 if (!frame)
178 return D3DRMERR_BADVALUE;
180 *frame = NULL;
182 if (index >= This->size)
183 return D3DRMERR_BADVALUE;
185 IDirect3DRMFrame_AddRef(This->frames[index]);
186 *frame = This->frames[index];
188 return D3DRM_OK;
191 static const struct IDirect3DRMFrameArrayVtbl Direct3DRMFrameArray_Vtbl =
193 /*** IUnknown methods ***/
194 IDirect3DRMFrameArrayImpl_QueryInterface,
195 IDirect3DRMFrameArrayImpl_AddRef,
196 IDirect3DRMFrameArrayImpl_Release,
197 /*** IDirect3DRMArray methods ***/
198 IDirect3DRMFrameArrayImpl_GetSize,
199 /*** IDirect3DRMFrameArray methods ***/
200 IDirect3DRMFrameArrayImpl_GetElement
203 static HRESULT Direct3DRMFrameArray_create(IDirect3DRMFrameArray** obj)
205 IDirect3DRMFrameArrayImpl* object;
207 TRACE("(%p)\n", obj);
209 *obj = NULL;
211 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMFrameArrayImpl));
212 if (!object)
213 return E_OUTOFMEMORY;
215 object->IDirect3DRMFrameArray_iface.lpVtbl = &Direct3DRMFrameArray_Vtbl;
216 object->ref = 1;
218 *obj = &object->IDirect3DRMFrameArray_iface;
220 return S_OK;
223 static HRESULT WINAPI IDirect3DRMVisualArrayImpl_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out)
225 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
227 if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray)
228 || IsEqualGUID(riid, &IID_IUnknown))
230 IDirect3DRMVisualArray_AddRef(iface);
231 *out = iface;
232 return S_OK;
235 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
237 *out = NULL;
238 return E_NOINTERFACE;
241 static ULONG WINAPI IDirect3DRMVisualArrayImpl_AddRef(IDirect3DRMVisualArray* iface)
243 IDirect3DRMVisualArrayImpl *This = impl_from_IDirect3DRMVisualArray(iface);
244 ULONG ref = InterlockedIncrement(&This->ref);
246 TRACE("(%p)->(): new ref = %u\n", iface, ref);
248 return ref;
251 static ULONG WINAPI IDirect3DRMVisualArrayImpl_Release(IDirect3DRMVisualArray* iface)
253 IDirect3DRMVisualArrayImpl *This = impl_from_IDirect3DRMVisualArray(iface);
254 ULONG ref = InterlockedDecrement(&This->ref);
255 ULONG i;
257 TRACE("(%p)->(): new ref = %u\n", iface, ref);
259 if (!ref)
261 for (i = 0; i < This->size; i++)
262 IDirect3DRMVisual_Release(This->visuals[i]);
263 HeapFree(GetProcessHeap(), 0, This->visuals);
264 HeapFree(GetProcessHeap(), 0, This);
267 return ref;
270 /*** IDirect3DRMArray methods ***/
271 static DWORD WINAPI IDirect3DRMVisualArrayImpl_GetSize(IDirect3DRMVisualArray* iface)
273 IDirect3DRMVisualArrayImpl *This = impl_from_IDirect3DRMVisualArray(iface);
275 TRACE("(%p)->() = %d\n", iface, This->size);
277 return This->size;
280 /*** IDirect3DRMVisualArray methods ***/
281 static HRESULT WINAPI IDirect3DRMVisualArrayImpl_GetElement(IDirect3DRMVisualArray *iface,
282 DWORD index, IDirect3DRMVisual **visual)
284 IDirect3DRMVisualArrayImpl *This = impl_from_IDirect3DRMVisualArray(iface);
286 TRACE("(%p)->(%u, %p)\n", iface, index, visual);
288 if (!visual)
289 return D3DRMERR_BADVALUE;
291 *visual = NULL;
293 if (index >= This->size)
294 return D3DRMERR_BADVALUE;
296 IDirect3DRMVisual_AddRef(This->visuals[index]);
297 *visual = This->visuals[index];
299 return D3DRM_OK;
302 static const struct IDirect3DRMVisualArrayVtbl Direct3DRMVisualArray_Vtbl =
304 /*** IUnknown methods ***/
305 IDirect3DRMVisualArrayImpl_QueryInterface,
306 IDirect3DRMVisualArrayImpl_AddRef,
307 IDirect3DRMVisualArrayImpl_Release,
308 /*** IDirect3DRMArray methods ***/
309 IDirect3DRMVisualArrayImpl_GetSize,
310 /*** IDirect3DRMVisualArray methods ***/
311 IDirect3DRMVisualArrayImpl_GetElement
314 static HRESULT Direct3DRMVisualArray_create(IDirect3DRMVisualArray** ret_iface)
316 IDirect3DRMVisualArrayImpl* object;
318 TRACE("(%p)\n", ret_iface);
320 *ret_iface = NULL;
322 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMVisualArrayImpl));
323 if (!object)
324 return E_OUTOFMEMORY;
326 object->IDirect3DRMVisualArray_iface.lpVtbl = &Direct3DRMVisualArray_Vtbl;
327 object->ref = 1;
329 *ret_iface = &object->IDirect3DRMVisualArray_iface;
331 return S_OK;
334 static HRESULT WINAPI d3drm_light_array_QueryInterface(IDirect3DRMLightArray *iface, REFIID riid, void **out)
336 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
338 if (IsEqualGUID(riid, &IID_IDirect3DRMLightArray)
339 || IsEqualGUID(riid, &IID_IUnknown))
341 IDirect3DRMLightArray_AddRef(iface);
342 *out = iface;
343 return S_OK;
346 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
348 *out = NULL;
349 return E_NOINTERFACE;
352 static ULONG WINAPI d3drm_light_array_AddRef(IDirect3DRMLightArray *iface)
354 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
355 ULONG refcount = InterlockedIncrement(&array->ref);
357 TRACE("%p increasing refcount to %u.\n", iface, refcount);
359 return refcount;
362 static ULONG WINAPI d3drm_light_array_Release(IDirect3DRMLightArray *iface)
364 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
365 ULONG refcount = InterlockedDecrement(&array->ref);
366 ULONG i;
368 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
370 if (!refcount)
372 for (i = 0; i < array->size; ++i)
374 IDirect3DRMLight_Release(array->lights[i]);
376 HeapFree(GetProcessHeap(), 0, array->lights);
377 HeapFree(GetProcessHeap(), 0, array);
380 return refcount;
383 static DWORD WINAPI d3drm_light_array_GetSize(IDirect3DRMLightArray *iface)
385 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
387 TRACE("iface %p.\n", iface);
389 return array->size;
392 static HRESULT WINAPI d3drm_light_array_GetElement(IDirect3DRMLightArray *iface,
393 DWORD index, IDirect3DRMLight **light)
395 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
397 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
399 if (!light)
400 return D3DRMERR_BADVALUE;
402 if (index >= array->size)
404 *light = NULL;
405 return D3DRMERR_BADVALUE;
408 IDirect3DRMLight_AddRef(array->lights[index]);
409 *light = array->lights[index];
411 return D3DRM_OK;
414 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
416 d3drm_light_array_QueryInterface,
417 d3drm_light_array_AddRef,
418 d3drm_light_array_Release,
419 d3drm_light_array_GetSize,
420 d3drm_light_array_GetElement,
423 static struct d3drm_light_array *d3drm_light_array_create(void)
425 struct d3drm_light_array *array;
427 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
428 return NULL;
430 array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl;
431 array->ref = 1;
433 return array;
436 /*** IUnknown methods ***/
437 static HRESULT WINAPI IDirect3DRMFrame2Impl_QueryInterface(IDirect3DRMFrame2* iface,
438 REFIID riid, void** object)
440 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
442 TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
444 *object = NULL;
446 if(IsEqualGUID(riid, &IID_IUnknown) ||
447 IsEqualGUID(riid, &IID_IDirect3DRMFrame) ||
448 IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
450 *object = &This->IDirect3DRMFrame2_iface;
452 else if(IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
454 *object = &This->IDirect3DRMFrame3_iface;
456 else
458 FIXME("interface %s not implemented\n", debugstr_guid(riid));
459 return E_NOINTERFACE;
462 IDirect3DRMFrame2_AddRef(iface);
463 return S_OK;
466 static ULONG WINAPI IDirect3DRMFrame2Impl_AddRef(IDirect3DRMFrame2* iface)
468 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
469 ULONG ref = InterlockedIncrement(&This->ref);
471 TRACE("(%p)->(): new ref = %d\n", This, ref);
473 return ref;
476 static ULONG WINAPI IDirect3DRMFrame2Impl_Release(IDirect3DRMFrame2* iface)
478 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
479 ULONG ref = InterlockedDecrement(&This->ref);
480 ULONG i;
482 TRACE("(%p)->(): new ref = %d\n", This, ref);
484 if (!ref)
486 for (i = 0; i < This->nb_children; i++)
487 IDirect3DRMFrame3_Release(This->children[i]);
488 HeapFree(GetProcessHeap(), 0, This->children);
489 for (i = 0; i < This->nb_visuals; i++)
490 IDirect3DRMVisual_Release(This->visuals[i]);
491 HeapFree(GetProcessHeap(), 0, This->visuals);
492 for (i = 0; i < This->nb_lights; i++)
493 IDirect3DRMLight_Release(This->lights[i]);
494 HeapFree(GetProcessHeap(), 0, This->lights);
495 HeapFree(GetProcessHeap(), 0, This);
498 return ref;
501 /*** IDirect3DRMObject methods ***/
502 static HRESULT WINAPI IDirect3DRMFrame2Impl_Clone(IDirect3DRMFrame2 *iface,
503 IUnknown *outer, REFIID iid, void **out)
505 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
507 return E_NOTIMPL;
510 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddDestroyCallback(IDirect3DRMFrame2 *iface,
511 D3DRMOBJECTCALLBACK cb, void *ctx)
513 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
515 return E_NOTIMPL;
518 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
519 D3DRMOBJECTCALLBACK cb, void *ctx)
521 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
523 return E_NOTIMPL;
526 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetAppData(IDirect3DRMFrame2* iface,
527 DWORD data)
529 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
531 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
533 return E_NOTIMPL;
536 static DWORD WINAPI IDirect3DRMFrame2Impl_GetAppData(IDirect3DRMFrame2* iface)
538 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
540 FIXME("(%p/%p)->(): stub\n", iface, This);
542 return 0;
545 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetName(IDirect3DRMFrame2 *iface, const char *name)
547 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
549 return E_NOTIMPL;
552 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
554 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
556 return E_NOTIMPL;
559 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
561 IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame2(iface);
563 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
565 return IDirect3DRMFrame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
568 /*** IDirect3DRMFrame methods ***/
569 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
571 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
572 IDirect3DRMFrame3 *frame;
573 HRESULT hr;
575 TRACE("(%p/%p)->(%p)\n", iface, This, child);
577 if (!child)
578 return D3DRMERR_BADOBJECT;
579 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void**)&frame);
580 if (hr != S_OK)
581 return D3DRMERR_BADOBJECT;
582 IDirect3DRMFrame_Release(child);
584 return IDirect3DRMFrame3_AddChild(&This->IDirect3DRMFrame3_iface, frame);
587 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
589 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
591 TRACE("(%p/%p)->(%p)\n", iface, This, light);
593 return IDirect3DRMFrame3_AddLight(&This->IDirect3DRMFrame3_iface, light);
596 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddMoveCallback(IDirect3DRMFrame2 *iface,
597 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
599 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
601 return E_NOTIMPL;
604 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddTransform(IDirect3DRMFrame2* iface,
605 D3DRMCOMBINETYPE type,
606 D3DRMMATRIX4D matrix)
608 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
610 TRACE("(%p/%p)->(%u,%p)\n", iface, This, type, matrix);
612 return IDirect3DRMFrame3_AddTransform(&This->IDirect3DRMFrame3_iface, type, matrix);
615 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddTranslation(IDirect3DRMFrame2* iface,
616 D3DRMCOMBINETYPE type,
617 D3DVALUE x, D3DVALUE y, D3DVALUE z)
619 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
621 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, x, y, z);
623 return E_NOTIMPL;
626 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddScale(IDirect3DRMFrame2* iface,
627 D3DRMCOMBINETYPE type,
628 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
630 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
632 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, sx, sy, sz);
634 return E_NOTIMPL;
637 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddRotation(IDirect3DRMFrame2* iface,
638 D3DRMCOMBINETYPE type,
639 D3DVALUE x, D3DVALUE y, D3DVALUE z,
640 D3DVALUE theta)
642 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
644 FIXME("(%p/%p)->(%u,%f,%f,%f,%f): stub\n", iface, This, type, x, y, z, theta);
646 return E_NOTIMPL;
649 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
651 IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame2(iface);
653 TRACE("iface %p, visual %p.\n", iface, visual);
655 return IDirect3DRMFrame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
658 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
660 IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame2(iface);
662 TRACE("iface %p, children %p.\n", iface, children);
664 return IDirect3DRMFrame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
667 static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetColor(IDirect3DRMFrame2* iface)
669 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
671 FIXME("(%p/%p)->(): stub\n", iface, This);
673 return 0;
676 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
678 IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame2(iface);
680 TRACE("iface %p, lights %p.\n", iface, lights);
682 return IDirect3DRMFrame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
685 static D3DRMMATERIALMODE WINAPI IDirect3DRMFrame2Impl_GetMaterialMode(IDirect3DRMFrame2* iface)
687 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
689 FIXME("(%p/%p)->(): stub\n", iface, This);
691 return D3DRMMATERIAL_FROMPARENT;
694 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **frame)
696 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
698 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
700 if (!frame)
701 return D3DRMERR_BADVALUE;
703 if (This->parent)
705 *frame = (IDirect3DRMFrame *)&This->parent->IDirect3DRMFrame2_iface;
706 IDirect3DRMFrame_AddRef(*frame);
708 else
710 *frame = NULL;
713 return D3DRM_OK;
716 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetPosition(IDirect3DRMFrame2 *iface,
717 IDirect3DRMFrame *reference, D3DVECTOR *return_position)
719 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
721 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, reference, return_position);
723 return E_NOTIMPL;
726 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetRotation(IDirect3DRMFrame2 *iface,
727 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *return_theta)
729 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
731 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, axis, return_theta);
733 return E_NOTIMPL;
736 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
738 FIXME("iface %p, frame %p stub!\n", iface, scene);
740 return E_NOTIMPL;
743 static D3DRMSORTMODE WINAPI IDirect3DRMFrame2Impl_GetSortMode(IDirect3DRMFrame2* iface)
745 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
747 FIXME("(%p/%p)->(): stub\n", iface, This);
749 return D3DRMSORT_FROMPARENT;
752 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
754 FIXME("iface %p, texture %p stub!\n", iface, texture);
756 return E_NOTIMPL;
759 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetTransform(IDirect3DRMFrame2* iface,
760 D3DRMMATRIX4D return_matrix)
762 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
764 TRACE("(%p/%p)->(%p)\n", iface, This, return_matrix);
766 memcpy(return_matrix, This->transform, sizeof(D3DRMMATRIX4D));
768 return D3DRM_OK;
771 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetVelocity(IDirect3DRMFrame2 *iface,
772 IDirect3DRMFrame *reference, D3DVECTOR *return_velocity, BOOL with_rotation)
774 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
776 FIXME("(%p/%p)->(%p,%p,%d): stub\n", iface, This, reference, return_velocity, with_rotation);
778 return E_NOTIMPL;
781 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetOrientation(IDirect3DRMFrame2 *iface,
782 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
784 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
786 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, dir, up);
788 return E_NOTIMPL;
791 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
793 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
794 IDirect3DRMVisualArrayImpl* obj;
795 HRESULT hr;
797 TRACE("(%p/%p)->(%p)\n", iface, This, visuals);
799 if (!visuals)
800 return D3DRMERR_BADVALUE;
802 hr = Direct3DRMVisualArray_create(visuals);
804 if (hr != D3DRM_OK)
805 return hr;
807 obj = (IDirect3DRMVisualArrayImpl*)*visuals;
809 obj->size = This->nb_visuals;
810 if (This->nb_visuals)
812 ULONG i;
813 if (!(obj->visuals = HeapAlloc(GetProcessHeap(), 0, This->nb_visuals * sizeof(*obj->visuals))))
814 return E_OUTOFMEMORY;
815 for (i = 0; i < This->nb_visuals; i++)
817 obj->visuals[i] = This->visuals[i];
818 IDirect3DRMVisual_AddRef(This->visuals[i]);
822 return D3DRM_OK;
825 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetTextureTopology(IDirect3DRMFrame2* iface,
826 BOOL *wrap_u, BOOL *wrap_v)
828 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
830 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, wrap_u, wrap_v);
832 return E_NOTIMPL;
835 static HRESULT WINAPI IDirect3DRMFrame2Impl_InverseTransform(IDirect3DRMFrame2* iface,
836 D3DVECTOR *d, D3DVECTOR *s)
838 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
840 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
842 return E_NOTIMPL;
845 static HRESULT WINAPI IDirect3DRMFrame2Impl_Load(IDirect3DRMFrame2 *iface, void *filename,
846 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
848 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
849 iface, filename, name, flags, cb, ctx);
851 return E_NOTIMPL;
854 static HRESULT WINAPI IDirect3DRMFrame2Impl_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
855 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
857 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
859 return E_NOTIMPL;
862 static HRESULT WINAPI IDirect3DRMFrame2Impl_Move(IDirect3DRMFrame2* iface, D3DVALUE delta)
864 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
866 FIXME("(%p/%p)->(%f): stub\n", iface, This, delta);
868 return E_NOTIMPL;
871 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *frame)
873 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
874 IDirect3DRMFrame3 *child;
875 HRESULT hr;
877 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
879 if (!frame)
880 return D3DRMERR_BADOBJECT;
881 hr = IDirect3DRMFrame_QueryInterface(frame, &IID_IDirect3DRMFrame3, (void**)&child);
882 if (hr != S_OK)
883 return D3DRMERR_BADOBJECT;
884 IDirect3DRMFrame_Release(frame);
886 return IDirect3DRMFrame3_DeleteChild(&This->IDirect3DRMFrame3_iface, child);
889 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
891 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
893 TRACE("(%p/%p)->(%p)\n", iface, This, light);
895 return IDirect3DRMFrame3_DeleteLight(&This->IDirect3DRMFrame3_iface, light);
898 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
899 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
901 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
903 return E_NOTIMPL;
906 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
908 IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame2(iface);
910 TRACE("iface %p, visual %p.\n", iface, visual);
912 return IDirect3DRMFrame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
915 static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetSceneBackground(IDirect3DRMFrame2* iface)
917 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
919 TRACE("(%p/%p)->()\n", iface, This);
921 return IDirect3DRMFrame3_GetSceneBackground(&This->IDirect3DRMFrame3_iface);
924 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
925 IDirectDrawSurface **surface)
927 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
929 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
931 return E_NOTIMPL;
934 static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetSceneFogColor(IDirect3DRMFrame2* iface)
936 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
938 FIXME("(%p/%p)->(): stub\n", iface, This);
940 return 0;
943 static BOOL WINAPI IDirect3DRMFrame2Impl_GetSceneFogEnable(IDirect3DRMFrame2* iface)
945 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
947 FIXME("(%p/%p)->(): stub\n", iface, This);
949 return FALSE;
952 static D3DRMFOGMODE WINAPI IDirect3DRMFrame2Impl_GetSceneFogMode(IDirect3DRMFrame2* iface)
954 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
956 FIXME("(%p/%p)->(): stub\n", iface, This);
958 return D3DRMFOG_LINEAR;
961 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetSceneFogParams(IDirect3DRMFrame2* iface,
962 D3DVALUE *return_start,
963 D3DVALUE *return_end,
964 D3DVALUE *return_density)
966 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
968 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, return_start, return_end, return_density);
970 return E_NOTIMPL;
973 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackground(IDirect3DRMFrame2* iface,
974 D3DCOLOR color)
976 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
978 TRACE("(%p/%p)->(%u)\n", iface, This, color);
980 return IDirect3DRMFrame3_SetSceneBackground(&This->IDirect3DRMFrame3_iface, color);
983 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackgroundRGB(IDirect3DRMFrame2* iface,
984 D3DVALUE red, D3DVALUE green,
985 D3DVALUE blue)
987 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
989 TRACE("(%p/%p)->(%f,%f,%f)\n", iface, This, red, green, blue);
991 return IDirect3DRMFrame3_SetSceneBackgroundRGB(&This->IDirect3DRMFrame3_iface, red, green, blue);
994 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
995 IDirectDrawSurface *surface)
997 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
999 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
1001 return E_NOTIMPL;
1004 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
1005 IDirect3DRMTexture *texture)
1007 FIXME("iface %p, texture %p stub!\n", iface, texture);
1009 return E_NOTIMPL;
1012 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogEnable(IDirect3DRMFrame2* iface, BOOL enable)
1014 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1016 FIXME("(%p/%p)->(%d): stub\n", iface, This, enable);
1018 return E_NOTIMPL;
1021 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogColor(IDirect3DRMFrame2* iface,
1022 D3DCOLOR color)
1024 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1026 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
1028 return E_NOTIMPL;
1031 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogMode(IDirect3DRMFrame2* iface,
1032 D3DRMFOGMODE mode)
1034 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1036 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1038 return E_NOTIMPL;
1041 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogParams(IDirect3DRMFrame2* iface,
1042 D3DVALUE start, D3DVALUE end,
1043 D3DVALUE density)
1045 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1047 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, start, end, density);
1049 return E_NOTIMPL;
1052 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetColor(IDirect3DRMFrame2* iface, D3DCOLOR color)
1054 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1056 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
1058 return E_NOTIMPL;
1061 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetColorRGB(IDirect3DRMFrame2* iface, D3DVALUE red,
1062 D3DVALUE green, D3DVALUE blue)
1064 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1066 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
1068 return E_NOTIMPL;
1071 static D3DRMZBUFFERMODE WINAPI IDirect3DRMFrame2Impl_GetZbufferMode(IDirect3DRMFrame2* iface)
1073 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1075 FIXME("(%p/%p)->(): stub\n", iface, This);
1077 return D3DRMZBUFFER_FROMPARENT;
1080 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetMaterialMode(IDirect3DRMFrame2* iface,
1081 D3DRMMATERIALMODE mode)
1083 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1085 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1087 return E_NOTIMPL;
1090 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
1091 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
1093 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1094 iface, reference, dx, dy, dz, ux, uy, uz);
1096 return E_NOTIMPL;
1099 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetPosition(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
1100 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1102 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
1104 return E_NOTIMPL;
1107 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetRotation(IDirect3DRMFrame2 *iface,
1108 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1110 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1111 iface, reference, x, y, z, theta);
1113 return E_NOTIMPL;
1116 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSortMode(IDirect3DRMFrame2* iface,
1117 D3DRMSORTMODE mode)
1119 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1121 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1123 return E_NOTIMPL;
1126 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
1128 FIXME("iface %p, texture %p stub!\n", iface, texture);
1130 return E_NOTIMPL;
1133 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetTextureTopology(IDirect3DRMFrame2* iface,
1134 BOOL wrap_u, BOOL wrap_v)
1136 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1138 FIXME("(%p/%p)->(%d,%d): stub\n", iface, This, wrap_u, wrap_v);
1140 return E_NOTIMPL;
1143 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetVelocity(IDirect3DRMFrame2 *iface,
1144 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
1146 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
1147 iface, reference, x, y, z, with_rotation);
1149 return E_NOTIMPL;
1152 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetZbufferMode(IDirect3DRMFrame2* iface,
1153 D3DRMZBUFFERMODE mode)
1155 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1157 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1159 return E_NOTIMPL;
1162 static HRESULT WINAPI IDirect3DRMFrame2Impl_Transform(IDirect3DRMFrame2* iface, D3DVECTOR *d,
1163 D3DVECTOR *s)
1165 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1167 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
1169 return E_NOTIMPL;
1172 /*** IDirect3DRMFrame2 methods ***/
1173 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddMoveCallback2(IDirect3DRMFrame2 *iface,
1174 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
1176 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
1178 return E_NOTIMPL;
1181 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
1183 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1185 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
1187 return E_NOTIMPL;
1190 static BOOL WINAPI IDirect3DRMFrame2Impl_GetBoxEnable(IDirect3DRMFrame2* iface)
1192 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1194 FIXME("(%p/%p)->(): stub\n", iface, This);
1196 return E_NOTIMPL;
1199 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetAxes(IDirect3DRMFrame2 *iface,
1200 D3DVECTOR *dir, D3DVECTOR *up)
1202 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1204 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, dir, up);
1206 return E_NOTIMPL;
1209 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
1211 FIXME("iface %p, material %p stub!\n", iface, material);
1213 return E_NOTIMPL;
1216 static BOOL WINAPI IDirect3DRMFrame2Impl_GetInheritAxes(IDirect3DRMFrame2* iface)
1218 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1220 FIXME("(%p/%p)->(): stub\n", iface, This);
1222 return E_NOTIMPL;
1225 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
1227 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
1229 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
1231 return E_NOTIMPL;
1234 static const struct IDirect3DRMFrame2Vtbl Direct3DRMFrame2_Vtbl =
1236 /*** IUnknown methods ***/
1237 IDirect3DRMFrame2Impl_QueryInterface,
1238 IDirect3DRMFrame2Impl_AddRef,
1239 IDirect3DRMFrame2Impl_Release,
1240 /*** IDirect3DRMObject methods ***/
1241 IDirect3DRMFrame2Impl_Clone,
1242 IDirect3DRMFrame2Impl_AddDestroyCallback,
1243 IDirect3DRMFrame2Impl_DeleteDestroyCallback,
1244 IDirect3DRMFrame2Impl_SetAppData,
1245 IDirect3DRMFrame2Impl_GetAppData,
1246 IDirect3DRMFrame2Impl_SetName,
1247 IDirect3DRMFrame2Impl_GetName,
1248 IDirect3DRMFrame2Impl_GetClassName,
1249 /*** IDirect3DRMFrame methods ***/
1250 IDirect3DRMFrame2Impl_AddChild,
1251 IDirect3DRMFrame2Impl_AddLight,
1252 IDirect3DRMFrame2Impl_AddMoveCallback,
1253 IDirect3DRMFrame2Impl_AddTransform,
1254 IDirect3DRMFrame2Impl_AddTranslation,
1255 IDirect3DRMFrame2Impl_AddScale,
1256 IDirect3DRMFrame2Impl_AddRotation,
1257 IDirect3DRMFrame2Impl_AddVisual,
1258 IDirect3DRMFrame2Impl_GetChildren,
1259 IDirect3DRMFrame2Impl_GetColor,
1260 IDirect3DRMFrame2Impl_GetLights,
1261 IDirect3DRMFrame2Impl_GetMaterialMode,
1262 IDirect3DRMFrame2Impl_GetParent,
1263 IDirect3DRMFrame2Impl_GetPosition,
1264 IDirect3DRMFrame2Impl_GetRotation,
1265 IDirect3DRMFrame2Impl_GetScene,
1266 IDirect3DRMFrame2Impl_GetSortMode,
1267 IDirect3DRMFrame2Impl_GetTexture,
1268 IDirect3DRMFrame2Impl_GetTransform,
1269 IDirect3DRMFrame2Impl_GetVelocity,
1270 IDirect3DRMFrame2Impl_GetOrientation,
1271 IDirect3DRMFrame2Impl_GetVisuals,
1272 IDirect3DRMFrame2Impl_GetTextureTopology,
1273 IDirect3DRMFrame2Impl_InverseTransform,
1274 IDirect3DRMFrame2Impl_Load,
1275 IDirect3DRMFrame2Impl_LookAt,
1276 IDirect3DRMFrame2Impl_Move,
1277 IDirect3DRMFrame2Impl_DeleteChild,
1278 IDirect3DRMFrame2Impl_DeleteLight,
1279 IDirect3DRMFrame2Impl_DeleteMoveCallback,
1280 IDirect3DRMFrame2Impl_DeleteVisual,
1281 IDirect3DRMFrame2Impl_GetSceneBackground,
1282 IDirect3DRMFrame2Impl_GetSceneBackgroundDepth,
1283 IDirect3DRMFrame2Impl_GetSceneFogColor,
1284 IDirect3DRMFrame2Impl_GetSceneFogEnable,
1285 IDirect3DRMFrame2Impl_GetSceneFogMode,
1286 IDirect3DRMFrame2Impl_GetSceneFogParams,
1287 IDirect3DRMFrame2Impl_SetSceneBackground,
1288 IDirect3DRMFrame2Impl_SetSceneBackgroundRGB,
1289 IDirect3DRMFrame2Impl_SetSceneBackgroundDepth,
1290 IDirect3DRMFrame2Impl_SetSceneBackgroundImage,
1291 IDirect3DRMFrame2Impl_SetSceneFogEnable,
1292 IDirect3DRMFrame2Impl_SetSceneFogColor,
1293 IDirect3DRMFrame2Impl_SetSceneFogMode,
1294 IDirect3DRMFrame2Impl_SetSceneFogParams,
1295 IDirect3DRMFrame2Impl_SetColor,
1296 IDirect3DRMFrame2Impl_SetColorRGB,
1297 IDirect3DRMFrame2Impl_GetZbufferMode,
1298 IDirect3DRMFrame2Impl_SetMaterialMode,
1299 IDirect3DRMFrame2Impl_SetOrientation,
1300 IDirect3DRMFrame2Impl_SetPosition,
1301 IDirect3DRMFrame2Impl_SetRotation,
1302 IDirect3DRMFrame2Impl_SetSortMode,
1303 IDirect3DRMFrame2Impl_SetTexture,
1304 IDirect3DRMFrame2Impl_SetTextureTopology,
1305 IDirect3DRMFrame2Impl_SetVelocity,
1306 IDirect3DRMFrame2Impl_SetZbufferMode,
1307 IDirect3DRMFrame2Impl_Transform,
1308 /*** IDirect3DRMFrame2 methods ***/
1309 IDirect3DRMFrame2Impl_AddMoveCallback2,
1310 IDirect3DRMFrame2Impl_GetBox,
1311 IDirect3DRMFrame2Impl_GetBoxEnable,
1312 IDirect3DRMFrame2Impl_GetAxes,
1313 IDirect3DRMFrame2Impl_GetMaterial,
1314 IDirect3DRMFrame2Impl_GetInheritAxes,
1315 IDirect3DRMFrame2Impl_GetHierarchyBox
1318 /*** IUnknown methods ***/
1319 static HRESULT WINAPI IDirect3DRMFrame3Impl_QueryInterface(IDirect3DRMFrame3* iface,
1320 REFIID riid, void** object)
1322 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1323 return IDirect3DRMFrame_QueryInterface(&This->IDirect3DRMFrame2_iface, riid, object);
1326 static ULONG WINAPI IDirect3DRMFrame3Impl_AddRef(IDirect3DRMFrame3* iface)
1328 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1329 return IDirect3DRMFrame2_AddRef(&This->IDirect3DRMFrame2_iface);
1332 static ULONG WINAPI IDirect3DRMFrame3Impl_Release(IDirect3DRMFrame3* iface)
1334 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1335 return IDirect3DRMFrame2_Release(&This->IDirect3DRMFrame2_iface);
1338 /*** IDirect3DRMObject methods ***/
1339 static HRESULT WINAPI IDirect3DRMFrame3Impl_Clone(IDirect3DRMFrame3 *iface,
1340 IUnknown *outer, REFIID iid, void **out)
1342 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
1344 return E_NOTIMPL;
1347 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddDestroyCallback(IDirect3DRMFrame3 *iface,
1348 D3DRMOBJECTCALLBACK cb, void *ctx)
1350 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1352 return E_NOTIMPL;
1355 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
1356 D3DRMOBJECTCALLBACK cb, void *ctx)
1358 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1360 return E_NOTIMPL;
1363 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetAppData(IDirect3DRMFrame3* iface,
1364 DWORD data)
1366 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1368 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
1370 return E_NOTIMPL;
1373 static DWORD WINAPI IDirect3DRMFrame3Impl_GetAppData(IDirect3DRMFrame3* iface)
1375 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1377 FIXME("(%p/%p)->(): stub\n", iface, This);
1379 return 0;
1382 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetName(IDirect3DRMFrame3 *iface, const char *name)
1384 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
1386 return E_NOTIMPL;
1389 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
1391 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
1393 return E_NOTIMPL;
1396 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
1398 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
1400 if (!size || *size < strlen("Frame") || !name)
1401 return E_INVALIDARG;
1403 strcpy(name, "Frame");
1404 *size = sizeof("Frame");
1406 return D3DRM_OK;
1409 /*** IDirect3DRMFrame methods ***/
1410 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1412 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1413 IDirect3DRMFrameImpl *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
1415 TRACE("(%p/%p)->(%p)\n", iface, This, child);
1417 if (!child_obj)
1418 return D3DRMERR_BADOBJECT;
1420 if (child_obj->parent)
1422 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
1424 if (parent == iface)
1426 /* Passed frame is already a child so return success */
1427 return D3DRM_OK;
1429 else
1431 /* Remove parent and continue */
1432 IDirect3DRMFrame3_DeleteChild(parent, child);
1436 if ((This->nb_children + 1) > This->children_capacity)
1438 ULONG new_capacity;
1439 IDirect3DRMFrame3** children;
1441 if (!This->children_capacity)
1443 new_capacity = 16;
1444 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
1446 else
1448 new_capacity = This->children_capacity * 2;
1449 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
1452 if (!children)
1453 return E_OUTOFMEMORY;
1455 This->children_capacity = new_capacity;
1456 This->children = children;
1459 This->children[This->nb_children++] = child;
1460 IDirect3DRMFrame3_AddRef(child);
1461 child_obj->parent = This;
1463 return D3DRM_OK;
1466 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1468 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1469 ULONG i;
1470 IDirect3DRMLight** lights;
1472 TRACE("(%p/%p)->(%p)\n", iface, This, light);
1474 if (!light)
1475 return D3DRMERR_BADOBJECT;
1477 /* Check if already existing and return gracefully without increasing ref count */
1478 for (i = 0; i < This->nb_lights; i++)
1479 if (This->lights[i] == light)
1480 return D3DRM_OK;
1482 if ((This->nb_lights + 1) > This->lights_capacity)
1484 ULONG new_capacity;
1486 if (!This->lights_capacity)
1488 new_capacity = 16;
1489 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
1491 else
1493 new_capacity = This->lights_capacity * 2;
1494 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
1497 if (!lights)
1498 return E_OUTOFMEMORY;
1500 This->lights_capacity = new_capacity;
1501 This->lights = lights;
1504 This->lights[This->nb_lights++] = light;
1505 IDirect3DRMLight_AddRef(light);
1507 return D3DRM_OK;
1510 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddMoveCallback(IDirect3DRMFrame3 *iface,
1511 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
1513 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
1515 return E_NOTIMPL;
1518 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddTransform(IDirect3DRMFrame3* iface,
1519 D3DRMCOMBINETYPE type,
1520 D3DRMMATRIX4D matrix)
1522 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1524 TRACE("(%p/%p)->(%u,%p)\n", iface, This, type, matrix);
1526 switch (type)
1528 case D3DRMCOMBINE_REPLACE:
1529 memcpy(This->transform, matrix, sizeof(D3DRMMATRIX4D));
1530 break;
1532 case D3DRMCOMBINE_BEFORE:
1533 FIXME("D3DRMCOMBINE_BEFORE not supported yed\n");
1534 break;
1536 case D3DRMCOMBINE_AFTER:
1537 FIXME("D3DRMCOMBINE_AFTER not supported yed\n");
1538 break;
1540 default:
1541 WARN("Unknown Combine Type %u\n", type);
1542 return D3DRMERR_BADVALUE;
1545 return S_OK;
1548 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddTranslation(IDirect3DRMFrame3* iface,
1549 D3DRMCOMBINETYPE type,
1550 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1552 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1554 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, x, y, z);
1556 return E_NOTIMPL;
1559 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddScale(IDirect3DRMFrame3* iface,
1560 D3DRMCOMBINETYPE type,
1561 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1563 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1565 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, sx, sy, sz);
1567 return E_NOTIMPL;
1570 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddRotation(IDirect3DRMFrame3* iface,
1571 D3DRMCOMBINETYPE type,
1572 D3DVALUE x, D3DVALUE y, D3DVALUE z,
1573 D3DVALUE theta)
1575 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1577 FIXME("(%p/%p)->(%u,%f,%f,%f,%f): stub\n", iface, This, type, x, y, z, theta);
1579 return E_NOTIMPL;
1582 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1584 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1585 ULONG i;
1586 IDirect3DRMVisual** visuals;
1588 TRACE("iface %p, visual %p.\n", iface, visual);
1590 if (!visual)
1591 return D3DRMERR_BADOBJECT;
1593 /* Check if already existing and return gracefully without increasing ref count */
1594 for (i = 0; i < This->nb_visuals; i++)
1595 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1596 return D3DRM_OK;
1598 if ((This->nb_visuals + 1) > This->visuals_capacity)
1600 ULONG new_capacity;
1602 if (!This->visuals_capacity)
1604 new_capacity = 16;
1605 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1607 else
1609 new_capacity = This->visuals_capacity * 2;
1610 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1613 if (!visuals)
1614 return E_OUTOFMEMORY;
1616 This->visuals_capacity = new_capacity;
1617 This->visuals = visuals;
1620 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1621 IDirect3DRMVisual_AddRef(visual);
1623 return D3DRM_OK;
1626 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1628 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1629 IDirect3DRMFrameArrayImpl* obj;
1630 HRESULT hr;
1632 TRACE("(%p/%p)->(%p)\n", iface, This, children);
1634 if (!children)
1635 return D3DRMERR_BADVALUE;
1637 hr = Direct3DRMFrameArray_create(children);
1639 if (hr != D3DRM_OK)
1640 return hr;
1642 obj = (IDirect3DRMFrameArrayImpl*)*children;
1644 obj->size = This->nb_children;
1645 if (This->nb_children)
1647 ULONG i;
1648 if (!(obj->frames = HeapAlloc(GetProcessHeap(), 0, This->nb_children * sizeof(*obj->frames))))
1649 return E_OUTOFMEMORY;
1650 for (i = 0; i < This->nb_children; i++)
1651 IDirect3DRMFrame3_QueryInterface(This->children[i], &IID_IDirect3DRMFrame, (void**)&obj->frames[i]);
1654 return D3DRM_OK;
1657 static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetColor(IDirect3DRMFrame3* iface)
1659 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1661 FIXME("(%p/%p)->(): stub\n", iface, This);
1663 return 0;
1666 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1668 IDirect3DRMFrameImpl *frame = impl_from_IDirect3DRMFrame3(iface);
1669 struct d3drm_light_array *array;
1671 TRACE("iface %p, lights %p.\n", iface, lights);
1673 if (!lights)
1674 return D3DRMERR_BADVALUE;
1676 if (!(array = d3drm_light_array_create()))
1677 return E_OUTOFMEMORY;
1679 array->size = frame->nb_lights;
1680 if (frame->nb_lights)
1682 ULONG i;
1684 if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, frame->nb_lights * sizeof(*array->lights))))
1685 return E_OUTOFMEMORY;
1686 for (i = 0; i < frame->nb_lights; ++i)
1688 IDirect3DRMLight_QueryInterface(frame->lights[i], &IID_IDirect3DRMLight, (void **)&array->lights[i]);
1692 *lights = &array->IDirect3DRMLightArray_iface;
1694 return D3DRM_OK;
1697 static D3DRMMATERIALMODE WINAPI IDirect3DRMFrame3Impl_GetMaterialMode(IDirect3DRMFrame3* iface)
1699 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1701 FIXME("(%p/%p)->(): stub\n", iface, This);
1703 return D3DRMMATERIAL_FROMPARENT;
1706 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **frame)
1708 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1710 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
1712 if (!frame)
1713 return D3DRMERR_BADVALUE;
1715 if (This->parent)
1717 *frame = &This->parent->IDirect3DRMFrame3_iface;
1718 IDirect3DRMFrame_AddRef(*frame);
1720 else
1722 *frame = NULL;
1725 return D3DRM_OK;
1728 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetPosition(IDirect3DRMFrame3 *iface,
1729 IDirect3DRMFrame3 *reference, D3DVECTOR *return_position)
1731 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1733 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, reference, return_position);
1735 return E_NOTIMPL;
1738 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetRotation(IDirect3DRMFrame3 *iface,
1739 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *return_theta)
1741 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1743 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, axis, return_theta);
1745 return E_NOTIMPL;
1748 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1750 FIXME("iface %p, scene %p stub!\n", iface, scene);
1752 return E_NOTIMPL;
1755 static D3DRMSORTMODE WINAPI IDirect3DRMFrame3Impl_GetSortMode(IDirect3DRMFrame3* iface)
1757 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1759 FIXME("(%p/%p)->(): stub\n", iface, This);
1761 return D3DRMSORT_FROMPARENT;
1764 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1766 FIXME("iface %p, texture %p stub!\n", iface, texture);
1768 return E_NOTIMPL;
1771 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetTransform(IDirect3DRMFrame3 *iface,
1772 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D return_matrix)
1774 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1776 TRACE("(%p/%p)->(%p,%p)\n", iface, This, reference, return_matrix);
1778 if (reference)
1779 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1781 memcpy(return_matrix, This->transform, sizeof(D3DRMMATRIX4D));
1783 return D3DRM_OK;
1786 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetVelocity(IDirect3DRMFrame3 *iface,
1787 IDirect3DRMFrame3 *reference, D3DVECTOR *return_velocity, BOOL with_rotation)
1789 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1791 FIXME("(%p/%p)->(%p,%p,%d): stub\n", iface, This, reference, return_velocity, with_rotation);
1793 return E_NOTIMPL;
1796 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetOrientation(IDirect3DRMFrame3 *iface,
1797 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1799 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1801 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, dir, up);
1803 return E_NOTIMPL;
1806 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetVisuals(IDirect3DRMFrame3 *iface,
1807 DWORD *count, IUnknown **visuals)
1809 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1811 return E_NOTIMPL;
1814 static HRESULT WINAPI IDirect3DRMFrame3Impl_InverseTransform(IDirect3DRMFrame3* iface,
1815 D3DVECTOR *d, D3DVECTOR *s)
1817 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1819 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
1821 return E_NOTIMPL;
1824 static HRESULT WINAPI IDirect3DRMFrame3Impl_Load(IDirect3DRMFrame3 *iface, void *filename,
1825 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1827 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1828 iface, filename, name, flags, cb, ctx);
1830 return E_NOTIMPL;
1833 static HRESULT WINAPI IDirect3DRMFrame3Impl_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1834 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1836 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1838 return E_NOTIMPL;
1841 static HRESULT WINAPI IDirect3DRMFrame3Impl_Move(IDirect3DRMFrame3* iface, D3DVALUE delta)
1843 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1845 FIXME("(%p/%p)->(%f): stub\n", iface, This, delta);
1847 return E_NOTIMPL;
1850 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *frame)
1852 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1853 IDirect3DRMFrameImpl *frame_obj = unsafe_impl_from_IDirect3DRMFrame3(frame);
1854 ULONG i;
1856 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
1858 if (!frame_obj)
1859 return D3DRMERR_BADOBJECT;
1861 /* Check if child exists */
1862 for (i = 0; i < This->nb_children; i++)
1863 if (This->children[i] == frame)
1864 break;
1866 if (i == This->nb_children)
1867 return D3DRMERR_BADVALUE;
1869 memmove(This->children + i, This->children + i + 1, sizeof(IDirect3DRMFrame3*) * (This->nb_children - 1 - i));
1870 IDirect3DRMFrame3_Release(frame);
1871 frame_obj->parent = NULL;
1872 This->nb_children--;
1874 return D3DRM_OK;
1877 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1879 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1880 ULONG i;
1882 TRACE("(%p/%p)->(%p)\n", iface, This, light);
1884 if (!light)
1885 return D3DRMERR_BADOBJECT;
1887 /* Check if visual exists */
1888 for (i = 0; i < This->nb_lights; i++)
1889 if (This->lights[i] == light)
1890 break;
1892 if (i == This->nb_lights)
1893 return D3DRMERR_BADVALUE;
1895 memmove(This->lights + i, This->lights + i + 1, sizeof(IDirect3DRMLight*) * (This->nb_lights - 1 - i));
1896 IDirect3DRMLight_Release(light);
1897 This->nb_lights--;
1899 return D3DRM_OK;
1902 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1903 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1905 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1907 return E_NOTIMPL;
1910 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1912 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1913 ULONG i;
1915 TRACE("iface %p, visual %p.\n", iface, visual);
1917 if (!visual)
1918 return D3DRMERR_BADOBJECT;
1920 /* Check if visual exists */
1921 for (i = 0; i < This->nb_visuals; i++)
1922 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1923 break;
1925 if (i == This->nb_visuals)
1926 return D3DRMERR_BADVALUE;
1928 memmove(This->visuals + i, This->visuals + i + 1, sizeof(IDirect3DRMVisual*) * (This->nb_visuals - 1 - i));
1929 IDirect3DRMVisual_Release(visual);
1930 This->nb_visuals--;
1932 return D3DRM_OK;
1935 static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetSceneBackground(IDirect3DRMFrame3* iface)
1937 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1939 TRACE("(%p/%p)->()\n", iface, This);
1941 return This->scenebackground;
1944 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1945 IDirectDrawSurface **surface)
1947 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1949 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
1951 return E_NOTIMPL;
1954 static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetSceneFogColor(IDirect3DRMFrame3* iface)
1956 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1958 FIXME("(%p/%p)->(): stub\n", iface, This);
1960 return 0;
1963 static BOOL WINAPI IDirect3DRMFrame3Impl_GetSceneFogEnable(IDirect3DRMFrame3* iface)
1965 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1967 FIXME("(%p/%p)->(): stub\n", iface, This);
1969 return FALSE;
1972 static D3DRMFOGMODE WINAPI IDirect3DRMFrame3Impl_GetSceneFogMode(IDirect3DRMFrame3* iface)
1974 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1976 FIXME("(%p/%p)->(): stub\n", iface, This);
1978 return D3DRMFOG_LINEAR;
1981 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetSceneFogParams(IDirect3DRMFrame3* iface,
1982 D3DVALUE *return_start,
1983 D3DVALUE *return_end,
1984 D3DVALUE *return_density)
1986 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1988 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, return_start, return_end, return_density);
1990 return E_NOTIMPL;
1993 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackground(IDirect3DRMFrame3* iface,
1994 D3DCOLOR color)
1996 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1998 TRACE("(%p/%p)->(%u)\n", iface, This, color);
2000 This->scenebackground = color;
2002 return D3DRM_OK;
2005 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackgroundRGB(IDirect3DRMFrame3* iface,
2006 D3DVALUE red, D3DVALUE green,
2007 D3DVALUE blue)
2009 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2011 TRACE("(%p/%p)->(%f,%f,%f)\n", iface, This, red, green, blue);
2013 This->scenebackground = RGBA_MAKE((BYTE)(red * 255.0f),
2014 (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff);
2016 return D3DRM_OK;
2019 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
2020 IDirectDrawSurface *surface)
2022 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2024 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
2026 return E_NOTIMPL;
2029 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
2030 IDirect3DRMTexture3 *texture)
2032 FIXME("iface %p, texture %p stub!\n", iface, texture);
2034 return E_NOTIMPL;
2037 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogEnable(IDirect3DRMFrame3* iface, BOOL enable)
2039 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2041 FIXME("(%p/%p)->(%d): stub\n", iface, This, enable);
2043 return E_NOTIMPL;
2046 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogColor(IDirect3DRMFrame3* iface,
2047 D3DCOLOR color)
2049 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2051 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
2053 return E_NOTIMPL;
2056 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogMode(IDirect3DRMFrame3* iface,
2057 D3DRMFOGMODE mode)
2059 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2061 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
2063 return E_NOTIMPL;
2066 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogParams(IDirect3DRMFrame3* iface,
2067 D3DVALUE start, D3DVALUE end,
2068 D3DVALUE density)
2070 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2072 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, start, end, density);
2074 return E_NOTIMPL;
2077 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetColor(IDirect3DRMFrame3* iface, D3DCOLOR color)
2079 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2081 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
2083 return E_NOTIMPL;
2086 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetColorRGB(IDirect3DRMFrame3* iface, D3DVALUE red,
2087 D3DVALUE green, D3DVALUE blue)
2089 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2091 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
2093 return E_NOTIMPL;
2096 static D3DRMZBUFFERMODE WINAPI IDirect3DRMFrame3Impl_GetZbufferMode(IDirect3DRMFrame3* iface)
2098 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2100 FIXME("(%p/%p)->(): stub\n", iface, This);
2102 return D3DRMZBUFFER_FROMPARENT;
2105 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetMaterialMode(IDirect3DRMFrame3* iface,
2106 D3DRMMATERIALMODE mode)
2108 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2110 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
2112 return E_NOTIMPL;
2115 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2116 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2118 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2119 iface, reference, dx, dy, dz, ux, uy, uz);
2121 return E_NOTIMPL;
2124 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetPosition(IDirect3DRMFrame3 *iface,
2125 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2127 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2129 return E_NOTIMPL;
2132 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetRotation(IDirect3DRMFrame3 *iface,
2133 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2135 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2136 iface, reference, x, y, z, theta);
2138 return E_NOTIMPL;
2141 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSortMode(IDirect3DRMFrame3* iface,
2142 D3DRMSORTMODE mode)
2144 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2146 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
2148 return E_NOTIMPL;
2151 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
2153 FIXME("iface %p, texture %p stub!\n", iface, texture);
2155 return E_NOTIMPL;
2158 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetVelocity(IDirect3DRMFrame3 *iface,
2159 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2161 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
2162 iface, reference, x, y, z, with_rotation);
2164 return E_NOTIMPL;
2167 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetZbufferMode(IDirect3DRMFrame3* iface,
2168 D3DRMZBUFFERMODE mode)
2170 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2172 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
2174 return E_NOTIMPL;
2177 static HRESULT WINAPI IDirect3DRMFrame3Impl_Transform(IDirect3DRMFrame3* iface, D3DVECTOR *d,
2178 D3DVECTOR *s)
2180 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2182 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
2184 return E_NOTIMPL;
2187 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2189 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2191 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
2193 return E_NOTIMPL;
2196 static BOOL WINAPI IDirect3DRMFrame3Impl_GetBoxEnable(IDirect3DRMFrame3* iface)
2198 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2200 FIXME("(%p/%p)->(): stub\n", iface, This);
2202 return E_NOTIMPL;
2205 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2207 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2209 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, dir, up);
2211 return E_NOTIMPL;
2214 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2216 FIXME("iface %p, material %p stub!\n", iface, material);
2218 return E_NOTIMPL;
2221 static BOOL WINAPI IDirect3DRMFrame3Impl_GetInheritAxes(IDirect3DRMFrame3* iface)
2223 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2225 FIXME("(%p/%p)->(): stub\n", iface, This);
2227 return E_NOTIMPL;
2230 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetHierarchyBox(IDirect3DRMFrame3* iface, D3DRMBOX *box)
2232 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2234 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
2236 return E_NOTIMPL;
2239 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2241 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2243 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
2245 return E_NOTIMPL;
2248 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetBoxEnable(IDirect3DRMFrame3* iface, BOOL enable)
2250 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2252 FIXME("(%p/%p)->(%u): stub\n", iface, This, enable);
2254 return E_NOTIMPL;
2257 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetAxes(IDirect3DRMFrame3* iface,
2258 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
2259 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2261 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2263 FIXME("(%p/%p)->(%f,%f,%f,%f,%f,%f): stub\n", iface, This, dx, dy, dz, ux, uy, uz);
2265 return E_NOTIMPL;
2268 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetInheritAxes(IDirect3DRMFrame3* iface,
2269 BOOL inherit_from_parent)
2271 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2273 FIXME("(%p/%p)->(%u): stub\n", iface, This, inherit_from_parent);
2275 return E_NOTIMPL;
2278 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2280 FIXME("iface %p, material %p stub!\n", iface, material);
2282 return E_NOTIMPL;
2285 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetQuaternion(IDirect3DRMFrame3 *iface,
2286 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2288 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2290 return E_NOTIMPL;
2293 static HRESULT WINAPI IDirect3DRMFrame3Impl_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2294 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **return_visuals)
2296 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2298 FIXME("(%p/%p)->(%p,%p,%u,%p): stub\n", iface, This, reference, ray, flags, return_visuals);
2300 return E_NOTIMPL;
2303 static HRESULT WINAPI IDirect3DRMFrame3Impl_Save(IDirect3DRMFrame3 *iface,
2304 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2306 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2307 iface, debugstr_a(filename), format, flags);
2309 return E_NOTIMPL;
2312 static HRESULT WINAPI IDirect3DRMFrame3Impl_TransformVectors(IDirect3DRMFrame3 *iface,
2313 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2315 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2317 FIXME("(%p/%p)->(%p,%u,%p,%p): stub\n", iface, This, reference, num, dst, src);
2319 return E_NOTIMPL;
2322 static HRESULT WINAPI IDirect3DRMFrame3Impl_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2323 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2325 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2327 FIXME("(%p/%p)->(%p,%u,%p,%p): stub\n", iface, This, reference, num, dst, src);
2329 return E_NOTIMPL;
2332 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetTraversalOptions(IDirect3DRMFrame3* iface,
2333 DWORD flags)
2335 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2337 FIXME("(%p/%p)->(%u): stub\n", iface, This, flags);
2339 return E_NOTIMPL;
2342 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2344 FIXME("iface %p, flags %p stub!\n", iface, flags);
2346 return E_NOTIMPL;
2349 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogMethod(IDirect3DRMFrame3* iface,
2350 DWORD flags)
2352 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2354 FIXME("(%p/%p)->(%u): stub\n", iface, This, flags);
2356 return E_NOTIMPL;
2359 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2361 FIXME("iface %p, fogmode %p stub!\n", iface, fog_mode);
2363 return E_NOTIMPL;
2366 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2367 D3DRMMATERIALOVERRIDE *override)
2369 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2371 FIXME("(%p/%p)->(%p): stub\n", iface, This, override);
2373 return E_NOTIMPL;
2376 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2377 D3DRMMATERIALOVERRIDE *override)
2379 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2381 FIXME("(%p/%p)->(%p): stub\n", iface, This, override);
2383 return E_NOTIMPL;
2386 static const struct IDirect3DRMFrame3Vtbl Direct3DRMFrame3_Vtbl =
2388 /*** IUnknown methods ***/
2389 IDirect3DRMFrame3Impl_QueryInterface,
2390 IDirect3DRMFrame3Impl_AddRef,
2391 IDirect3DRMFrame3Impl_Release,
2392 /*** IDirect3DRMObject methods ***/
2393 IDirect3DRMFrame3Impl_Clone,
2394 IDirect3DRMFrame3Impl_AddDestroyCallback,
2395 IDirect3DRMFrame3Impl_DeleteDestroyCallback,
2396 IDirect3DRMFrame3Impl_SetAppData,
2397 IDirect3DRMFrame3Impl_GetAppData,
2398 IDirect3DRMFrame3Impl_SetName,
2399 IDirect3DRMFrame3Impl_GetName,
2400 IDirect3DRMFrame3Impl_GetClassName,
2401 /*** IDirect3DRMFrame3 methods ***/
2402 IDirect3DRMFrame3Impl_AddChild,
2403 IDirect3DRMFrame3Impl_AddLight,
2404 IDirect3DRMFrame3Impl_AddMoveCallback,
2405 IDirect3DRMFrame3Impl_AddTransform,
2406 IDirect3DRMFrame3Impl_AddTranslation,
2407 IDirect3DRMFrame3Impl_AddScale,
2408 IDirect3DRMFrame3Impl_AddRotation,
2409 IDirect3DRMFrame3Impl_AddVisual,
2410 IDirect3DRMFrame3Impl_GetChildren,
2411 IDirect3DRMFrame3Impl_GetColor,
2412 IDirect3DRMFrame3Impl_GetLights,
2413 IDirect3DRMFrame3Impl_GetMaterialMode,
2414 IDirect3DRMFrame3Impl_GetParent,
2415 IDirect3DRMFrame3Impl_GetPosition,
2416 IDirect3DRMFrame3Impl_GetRotation,
2417 IDirect3DRMFrame3Impl_GetScene,
2418 IDirect3DRMFrame3Impl_GetSortMode,
2419 IDirect3DRMFrame3Impl_GetTexture,
2420 IDirect3DRMFrame3Impl_GetTransform,
2421 IDirect3DRMFrame3Impl_GetVelocity,
2422 IDirect3DRMFrame3Impl_GetOrientation,
2423 IDirect3DRMFrame3Impl_GetVisuals,
2424 IDirect3DRMFrame3Impl_InverseTransform,
2425 IDirect3DRMFrame3Impl_Load,
2426 IDirect3DRMFrame3Impl_LookAt,
2427 IDirect3DRMFrame3Impl_Move,
2428 IDirect3DRMFrame3Impl_DeleteChild,
2429 IDirect3DRMFrame3Impl_DeleteLight,
2430 IDirect3DRMFrame3Impl_DeleteMoveCallback,
2431 IDirect3DRMFrame3Impl_DeleteVisual,
2432 IDirect3DRMFrame3Impl_GetSceneBackground,
2433 IDirect3DRMFrame3Impl_GetSceneBackgroundDepth,
2434 IDirect3DRMFrame3Impl_GetSceneFogColor,
2435 IDirect3DRMFrame3Impl_GetSceneFogEnable,
2436 IDirect3DRMFrame3Impl_GetSceneFogMode,
2437 IDirect3DRMFrame3Impl_GetSceneFogParams,
2438 IDirect3DRMFrame3Impl_SetSceneBackground,
2439 IDirect3DRMFrame3Impl_SetSceneBackgroundRGB,
2440 IDirect3DRMFrame3Impl_SetSceneBackgroundDepth,
2441 IDirect3DRMFrame3Impl_SetSceneBackgroundImage,
2442 IDirect3DRMFrame3Impl_SetSceneFogEnable,
2443 IDirect3DRMFrame3Impl_SetSceneFogColor,
2444 IDirect3DRMFrame3Impl_SetSceneFogMode,
2445 IDirect3DRMFrame3Impl_SetSceneFogParams,
2446 IDirect3DRMFrame3Impl_SetColor,
2447 IDirect3DRMFrame3Impl_SetColorRGB,
2448 IDirect3DRMFrame3Impl_GetZbufferMode,
2449 IDirect3DRMFrame3Impl_SetMaterialMode,
2450 IDirect3DRMFrame3Impl_SetOrientation,
2451 IDirect3DRMFrame3Impl_SetPosition,
2452 IDirect3DRMFrame3Impl_SetRotation,
2453 IDirect3DRMFrame3Impl_SetSortMode,
2454 IDirect3DRMFrame3Impl_SetTexture,
2455 IDirect3DRMFrame3Impl_SetVelocity,
2456 IDirect3DRMFrame3Impl_SetZbufferMode,
2457 IDirect3DRMFrame3Impl_Transform,
2458 IDirect3DRMFrame3Impl_GetBox,
2459 IDirect3DRMFrame3Impl_GetBoxEnable,
2460 IDirect3DRMFrame3Impl_GetAxes,
2461 IDirect3DRMFrame3Impl_GetMaterial,
2462 IDirect3DRMFrame3Impl_GetInheritAxes,
2463 IDirect3DRMFrame3Impl_GetHierarchyBox,
2464 IDirect3DRMFrame3Impl_SetBox,
2465 IDirect3DRMFrame3Impl_SetBoxEnable,
2466 IDirect3DRMFrame3Impl_SetAxes,
2467 IDirect3DRMFrame3Impl_SetInheritAxes,
2468 IDirect3DRMFrame3Impl_SetMaterial,
2469 IDirect3DRMFrame3Impl_SetQuaternion,
2470 IDirect3DRMFrame3Impl_RayPick,
2471 IDirect3DRMFrame3Impl_Save,
2472 IDirect3DRMFrame3Impl_TransformVectors,
2473 IDirect3DRMFrame3Impl_InverseTransformVectors,
2474 IDirect3DRMFrame3Impl_SetTraversalOptions,
2475 IDirect3DRMFrame3Impl_GetTraversalOptions,
2476 IDirect3DRMFrame3Impl_SetSceneFogMethod,
2477 IDirect3DRMFrame3Impl_GetSceneFogMethod,
2478 IDirect3DRMFrame3Impl_SetMaterialOverride,
2479 IDirect3DRMFrame3Impl_GetMaterialOverride
2482 static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2484 if (!iface)
2485 return NULL;
2486 assert(iface->lpVtbl == &Direct3DRMFrame3_Vtbl);
2488 return impl_from_IDirect3DRMFrame3(iface);
2491 HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent, IUnknown** ret_iface)
2493 IDirect3DRMFrameImpl* object;
2494 HRESULT hr;
2496 TRACE("(%s, %p, %p)\n", wine_dbgstr_guid(riid), parent, ret_iface);
2498 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMFrameImpl));
2499 if (!object)
2500 return E_OUTOFMEMORY;
2502 object->IDirect3DRMFrame2_iface.lpVtbl = &Direct3DRMFrame2_Vtbl;
2503 object->IDirect3DRMFrame3_iface.lpVtbl = &Direct3DRMFrame3_Vtbl;
2504 object->ref = 1;
2505 object->scenebackground = RGBA_MAKE(0, 0, 0, 0xff);
2507 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2509 if (parent)
2511 IDirect3DRMFrame3 *p;
2513 hr = IDirect3DRMFrame_QueryInterface(parent, &IID_IDirect3DRMFrame3, (void**)&p);
2514 if (hr != S_OK)
2516 HeapFree(GetProcessHeap(), 0, object);
2517 return hr;
2519 IDirect3DRMFrame_Release(parent);
2520 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2523 hr = IDirect3DRMFrame3_QueryInterface(&object->IDirect3DRMFrame3_iface, riid, (void**)ret_iface);
2524 IDirect3DRMFrame3_Release(&object->IDirect3DRMFrame3_iface);
2525 return S_OK;