ntdll: Add support for collided unwinds.
[wine.git] / dlls / d3drm / frame.c
blobd79a8e3ed6dec807c7f54bbdf82ae79e0e030dc5
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 struct d3drm_frame_array
43 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface;
44 LONG ref;
45 ULONG size;
46 IDirect3DRMFrame **frames;
49 struct d3drm_visual_array
51 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface;
52 LONG ref;
53 ULONG size;
54 IDirect3DRMVisual **visuals;
57 struct d3drm_light_array
59 IDirect3DRMLightArray IDirect3DRMLightArray_iface;
60 LONG ref;
61 ULONG size;
62 IDirect3DRMLight **lights;
65 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
67 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame_iface);
70 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
72 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame2_iface);
75 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
77 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame3_iface);
80 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
82 static inline struct d3drm_frame_array *impl_from_IDirect3DRMFrameArray(IDirect3DRMFrameArray *iface)
84 return CONTAINING_RECORD(iface, struct d3drm_frame_array, IDirect3DRMFrameArray_iface);
87 static inline struct d3drm_visual_array *impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray *iface)
89 return CONTAINING_RECORD(iface, struct d3drm_visual_array, IDirect3DRMVisualArray_iface);
92 static inline struct d3drm_light_array *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface)
94 return CONTAINING_RECORD(iface, struct d3drm_light_array, IDirect3DRMLightArray_iface);
97 static HRESULT WINAPI d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray *iface, REFIID riid, void **out)
99 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
101 if (IsEqualGUID(riid, &IID_IDirect3DRMFrameArray)
102 || IsEqualGUID(riid, &IID_IUnknown))
104 IDirect3DRMFrameArray_AddRef(iface);
105 *out = iface;
106 return S_OK;
109 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
111 *out = NULL;
112 return E_NOINTERFACE;
115 static ULONG WINAPI d3drm_frame_array_AddRef(IDirect3DRMFrameArray *iface)
117 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
118 ULONG refcount = InterlockedIncrement(&array->ref);
120 TRACE("%p increasing refcount to %u.\n", iface, refcount);
122 return refcount;
125 static ULONG WINAPI d3drm_frame_array_Release(IDirect3DRMFrameArray *iface)
127 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
128 ULONG refcount = InterlockedDecrement(&array->ref);
129 ULONG i;
131 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
133 if (!refcount)
135 for (i = 0; i < array->size; ++i)
137 IDirect3DRMFrame_Release(array->frames[i]);
139 HeapFree(GetProcessHeap(), 0, array->frames);
140 HeapFree(GetProcessHeap(), 0, array);
143 return refcount;
146 static DWORD WINAPI d3drm_frame_array_GetSize(IDirect3DRMFrameArray *iface)
148 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
150 TRACE("iface %p.\n", iface);
152 return array->size;
155 static HRESULT WINAPI d3drm_frame_array_GetElement(IDirect3DRMFrameArray *iface,
156 DWORD index, IDirect3DRMFrame **frame)
158 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
160 TRACE("iface %p, index %u, frame %p.\n", iface, index, frame);
162 if (!frame)
163 return D3DRMERR_BADVALUE;
165 if (index >= array->size)
167 *frame = NULL;
168 return D3DRMERR_BADVALUE;
171 IDirect3DRMFrame_AddRef(array->frames[index]);
172 *frame = array->frames[index];
174 return D3DRM_OK;
177 static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl =
179 d3drm_frame_array_QueryInterface,
180 d3drm_frame_array_AddRef,
181 d3drm_frame_array_Release,
182 d3drm_frame_array_GetSize,
183 d3drm_frame_array_GetElement,
186 static struct d3drm_frame_array *d3drm_frame_array_create(unsigned int frame_count, IDirect3DRMFrame3 **frames)
188 struct d3drm_frame_array *array;
189 unsigned int i;
191 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
192 return NULL;
194 array->IDirect3DRMFrameArray_iface.lpVtbl = &d3drm_frame_array_vtbl;
195 array->ref = 1;
196 array->size = frame_count;
198 if (frame_count)
200 if (!(array->frames = HeapAlloc(GetProcessHeap(), 0, frame_count * sizeof(*array->frames))))
202 HeapFree(GetProcessHeap(), 0, array);
203 return NULL;
206 for (i = 0; i < frame_count; ++i)
208 IDirect3DRMFrame3_QueryInterface(frames[i], &IID_IDirect3DRMFrame, (void **)&array->frames[i]);
212 return array;
215 static HRESULT WINAPI d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out)
217 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
219 if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray)
220 || IsEqualGUID(riid, &IID_IUnknown))
222 IDirect3DRMVisualArray_AddRef(iface);
223 *out = iface;
224 return S_OK;
227 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
229 *out = NULL;
230 return E_NOINTERFACE;
233 static ULONG WINAPI d3drm_visual_array_AddRef(IDirect3DRMVisualArray *iface)
235 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
236 ULONG refcount = InterlockedIncrement(&array->ref);
238 TRACE("%p increasing refcount to %u.\n", iface, refcount);
240 return refcount;
243 static ULONG WINAPI d3drm_visual_array_Release(IDirect3DRMVisualArray *iface)
245 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
246 ULONG refcount = InterlockedDecrement(&array->ref);
247 ULONG i;
249 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
251 if (!refcount)
253 for (i = 0; i < array->size; ++i)
255 IDirect3DRMVisual_Release(array->visuals[i]);
257 HeapFree(GetProcessHeap(), 0, array->visuals);
258 HeapFree(GetProcessHeap(), 0, array);
261 return refcount;
264 static DWORD WINAPI d3drm_visual_array_GetSize(IDirect3DRMVisualArray *iface)
266 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
268 TRACE("iface %p.\n", iface);
270 return array->size;
273 static HRESULT WINAPI d3drm_visual_array_GetElement(IDirect3DRMVisualArray *iface,
274 DWORD index, IDirect3DRMVisual **visual)
276 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
278 TRACE("iface %p, index %u, visual %p.\n", iface, index, visual);
280 if (!visual)
281 return D3DRMERR_BADVALUE;
283 if (index >= array->size)
285 *visual = NULL;
286 return D3DRMERR_BADVALUE;
289 IDirect3DRMVisual_AddRef(array->visuals[index]);
290 *visual = array->visuals[index];
292 return D3DRM_OK;
295 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl =
297 d3drm_visual_array_QueryInterface,
298 d3drm_visual_array_AddRef,
299 d3drm_visual_array_Release,
300 d3drm_visual_array_GetSize,
301 d3drm_visual_array_GetElement,
304 static struct d3drm_visual_array *d3drm_visual_array_create(unsigned int visual_count, IDirect3DRMVisual **visuals)
306 struct d3drm_visual_array *array;
307 unsigned int i;
309 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
310 return NULL;
312 array->IDirect3DRMVisualArray_iface.lpVtbl = &d3drm_visual_array_vtbl;
313 array->ref = 1;
314 array->size = visual_count;
316 if (visual_count)
318 if (!(array->visuals = HeapAlloc(GetProcessHeap(), 0, visual_count * sizeof(*array->visuals))))
320 HeapFree(GetProcessHeap(), 0, array);
321 return NULL;
324 for (i = 0; i < visual_count; ++i)
326 array->visuals[i] = visuals[i];
327 IDirect3DRMVisual_AddRef(array->visuals[i]);
331 return array;
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(unsigned int light_count, IDirect3DRMLight **lights)
425 struct d3drm_light_array *array;
426 unsigned int i;
428 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
429 return NULL;
431 array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl;
432 array->ref = 1;
433 array->size = light_count;
435 if (light_count)
437 if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, light_count * sizeof(*array->lights))))
439 HeapFree(GetProcessHeap(), 0, array);
440 return NULL;
443 for (i = 0; i < light_count; ++i)
445 array->lights[i] = lights[i];
446 IDirect3DRMLight_AddRef(array->lights[i]);
450 return array;
453 static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out)
455 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
457 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
459 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame)
460 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
461 || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
462 || IsEqualGUID(riid, &IID_IUnknown))
464 *out = &frame->IDirect3DRMFrame_iface;
466 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
468 *out = &frame->IDirect3DRMFrame2_iface;
470 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
472 *out = &frame->IDirect3DRMFrame3_iface;
474 else
476 *out = NULL;
477 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
478 return CLASS_E_CLASSNOTAVAILABLE;
481 IUnknown_AddRef((IUnknown *)*out);
482 return S_OK;
485 static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out)
487 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
489 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
491 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
494 static HRESULT WINAPI d3drm_frame1_QueryInterface(IDirect3DRMFrame *iface, REFIID riid, void **out)
496 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
498 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
500 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
503 static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface)
505 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
506 ULONG refcount = InterlockedIncrement(&frame->ref);
508 TRACE("%p increasing refcount to %u.\n", iface, refcount);
510 return refcount;
513 static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface)
515 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
517 TRACE("iface %p.\n", iface);
519 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
522 static ULONG WINAPI d3drm_frame1_AddRef(IDirect3DRMFrame *iface)
524 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
526 TRACE("iface %p.\n", iface);
528 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
531 static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
533 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
534 ULONG refcount = InterlockedDecrement(&frame->ref);
535 ULONG i;
537 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
539 if (!refcount)
541 for (i = 0; i < frame->nb_children; ++i)
543 IDirect3DRMFrame3_Release(frame->children[i]);
545 HeapFree(GetProcessHeap(), 0, frame->children);
546 for (i = 0; i < frame->nb_visuals; ++i)
548 IDirect3DRMVisual_Release(frame->visuals[i]);
550 HeapFree(GetProcessHeap(), 0, frame->visuals);
551 for (i = 0; i < frame->nb_lights; ++i)
553 IDirect3DRMLight_Release(frame->lights[i]);
555 HeapFree(GetProcessHeap(), 0, frame->lights);
556 HeapFree(GetProcessHeap(), 0, frame);
559 return refcount;
562 static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface)
564 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
566 TRACE("iface %p.\n", iface);
568 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
571 static ULONG WINAPI d3drm_frame1_Release(IDirect3DRMFrame *iface)
573 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
575 TRACE("iface %p.\n", iface);
577 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
580 static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface,
581 IUnknown *outer, REFIID iid, void **out)
583 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
585 return E_NOTIMPL;
588 static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface,
589 IUnknown *outer, REFIID iid, void **out)
591 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
593 return E_NOTIMPL;
596 static HRESULT WINAPI d3drm_frame1_Clone(IDirect3DRMFrame *iface,
597 IUnknown *outer, REFIID iid, void **out)
599 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
601 return E_NOTIMPL;
604 static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface,
605 D3DRMOBJECTCALLBACK cb, void *ctx)
607 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
609 return E_NOTIMPL;
612 static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface,
613 D3DRMOBJECTCALLBACK cb, void *ctx)
615 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
617 return E_NOTIMPL;
620 static HRESULT WINAPI d3drm_frame1_AddDestroyCallback(IDirect3DRMFrame *iface,
621 D3DRMOBJECTCALLBACK cb, void *ctx)
623 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
625 return E_NOTIMPL;
628 static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
629 D3DRMOBJECTCALLBACK cb, void *ctx)
631 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
633 return E_NOTIMPL;
636 static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
637 D3DRMOBJECTCALLBACK cb, void *ctx)
639 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
641 return E_NOTIMPL;
644 static HRESULT WINAPI d3drm_frame1_DeleteDestroyCallback(IDirect3DRMFrame *iface,
645 D3DRMOBJECTCALLBACK cb, void *ctx)
647 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
649 return E_NOTIMPL;
652 static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data)
654 FIXME("iface %p, data %#x stub!\n", iface, data);
656 return E_NOTIMPL;
659 static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data)
661 FIXME("iface %p, data %#x stub!\n", iface, data);
663 return E_NOTIMPL;
666 static HRESULT WINAPI d3drm_frame1_SetAppData(IDirect3DRMFrame *iface, DWORD data)
668 FIXME("iface %p, data %#x stub!\n", iface, data);
670 return E_NOTIMPL;
673 static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface)
675 FIXME("iface %p stub!\n", iface);
677 return 0;
680 static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface)
682 FIXME("iface %p stub!\n", iface);
684 return 0;
687 static DWORD WINAPI d3drm_frame1_GetAppData(IDirect3DRMFrame *iface)
689 FIXME("iface %p stub!\n", iface);
691 return 0;
694 static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name)
696 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
698 return E_NOTIMPL;
701 static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name)
703 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
705 return E_NOTIMPL;
708 static HRESULT WINAPI d3drm_frame1_SetName(IDirect3DRMFrame *iface, const char *name)
710 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
712 return E_NOTIMPL;
715 static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
717 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
719 return E_NOTIMPL;
722 static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
724 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
726 return E_NOTIMPL;
729 static HRESULT WINAPI d3drm_frame1_GetName(IDirect3DRMFrame *iface, DWORD *size, char *name)
731 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
733 return E_NOTIMPL;
736 static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
738 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
740 if (!size || *size < strlen("Frame") || !name)
741 return E_INVALIDARG;
743 strcpy(name, "Frame");
744 *size = sizeof("Frame");
746 return D3DRM_OK;
749 static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
751 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
753 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
755 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
758 static HRESULT WINAPI d3drm_frame1_GetClassName(IDirect3DRMFrame *iface, DWORD *size, char *name)
760 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
762 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
764 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
767 static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
769 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
770 struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
772 TRACE("iface %p, child %p.\n", iface, child);
774 if (!child_obj)
775 return D3DRMERR_BADOBJECT;
777 if (child_obj->parent)
779 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
781 if (parent == iface)
783 /* Passed frame is already a child so return success */
784 return D3DRM_OK;
786 else
788 /* Remove parent and continue */
789 IDirect3DRMFrame3_DeleteChild(parent, child);
793 if ((This->nb_children + 1) > This->children_capacity)
795 ULONG new_capacity;
796 IDirect3DRMFrame3** children;
798 if (!This->children_capacity)
800 new_capacity = 16;
801 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
803 else
805 new_capacity = This->children_capacity * 2;
806 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
809 if (!children)
810 return E_OUTOFMEMORY;
812 This->children_capacity = new_capacity;
813 This->children = children;
816 This->children[This->nb_children++] = child;
817 IDirect3DRMFrame3_AddRef(child);
818 child_obj->parent = This;
820 return D3DRM_OK;
823 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
825 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
826 IDirect3DRMFrame3 *child3;
827 HRESULT hr;
829 TRACE("iface %p, child %p.\n", iface, child);
831 if (!child)
832 return D3DRMERR_BADOBJECT;
833 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
834 if (hr != S_OK)
835 return D3DRMERR_BADOBJECT;
836 IDirect3DRMFrame_Release(child);
838 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
841 static HRESULT WINAPI d3drm_frame1_AddChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
843 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
844 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
846 TRACE("iface %p, child %p.\n", iface, child);
848 if (!child_frame)
849 return D3DRMERR_BADOBJECT;
851 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
854 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
856 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
857 ULONG i;
858 IDirect3DRMLight** lights;
860 TRACE("iface %p, light %p.\n", iface, light);
862 if (!light)
863 return D3DRMERR_BADOBJECT;
865 /* Check if already existing and return gracefully without increasing ref count */
866 for (i = 0; i < This->nb_lights; i++)
867 if (This->lights[i] == light)
868 return D3DRM_OK;
870 if ((This->nb_lights + 1) > This->lights_capacity)
872 ULONG new_capacity;
874 if (!This->lights_capacity)
876 new_capacity = 16;
877 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
879 else
881 new_capacity = This->lights_capacity * 2;
882 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
885 if (!lights)
886 return E_OUTOFMEMORY;
888 This->lights_capacity = new_capacity;
889 This->lights = lights;
892 This->lights[This->nb_lights++] = light;
893 IDirect3DRMLight_AddRef(light);
895 return D3DRM_OK;
898 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
900 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
902 TRACE("iface %p, light %p.\n", iface, light);
904 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
907 static HRESULT WINAPI d3drm_frame1_AddLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
909 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
911 TRACE("iface %p, light %p.\n", iface, light);
913 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
916 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
917 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
919 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
921 return E_NOTIMPL;
924 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
925 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
927 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
929 return E_NOTIMPL;
932 static HRESULT WINAPI d3drm_frame1_AddMoveCallback(IDirect3DRMFrame *iface,
933 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
935 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
937 return E_NOTIMPL;
940 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
941 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
943 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
945 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
947 switch (type)
949 case D3DRMCOMBINE_REPLACE:
950 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
951 break;
953 case D3DRMCOMBINE_BEFORE:
954 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
955 break;
957 case D3DRMCOMBINE_AFTER:
958 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
959 break;
961 default:
962 WARN("Unknown Combine Type %u\n", type);
963 return D3DRMERR_BADVALUE;
966 return S_OK;
969 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface,
970 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
972 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
974 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
976 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
979 static HRESULT WINAPI d3drm_frame1_AddTransform(IDirect3DRMFrame *iface,
980 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
982 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
984 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
986 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
989 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
990 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
992 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
994 return E_NOTIMPL;
997 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
998 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1000 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1002 return E_NOTIMPL;
1005 static HRESULT WINAPI d3drm_frame1_AddTranslation(IDirect3DRMFrame *iface,
1006 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1008 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1010 return E_NOTIMPL;
1013 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1014 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1016 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1018 return E_NOTIMPL;
1021 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
1022 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1024 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1026 return E_NOTIMPL;
1029 static HRESULT WINAPI d3drm_frame1_AddScale(IDirect3DRMFrame *iface,
1030 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1032 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1034 return E_NOTIMPL;
1037 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1038 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1040 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1041 iface, type, x, y, z, theta);
1043 return E_NOTIMPL;
1046 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
1047 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1049 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1051 return E_NOTIMPL;
1054 static HRESULT WINAPI d3drm_frame1_AddRotation(IDirect3DRMFrame *iface,
1055 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1057 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1059 return E_NOTIMPL;
1062 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1064 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1065 ULONG i;
1066 IDirect3DRMVisual** visuals;
1068 TRACE("iface %p, visual %p.\n", iface, visual);
1070 if (!visual)
1071 return D3DRMERR_BADOBJECT;
1073 /* Check if already existing and return gracefully without increasing ref count */
1074 for (i = 0; i < This->nb_visuals; i++)
1075 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1076 return D3DRM_OK;
1078 if ((This->nb_visuals + 1) > This->visuals_capacity)
1080 ULONG new_capacity;
1082 if (!This->visuals_capacity)
1084 new_capacity = 16;
1085 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1087 else
1089 new_capacity = This->visuals_capacity * 2;
1090 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1093 if (!visuals)
1094 return E_OUTOFMEMORY;
1096 This->visuals_capacity = new_capacity;
1097 This->visuals = visuals;
1100 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1101 IDirect3DRMVisual_AddRef(visual);
1103 return D3DRM_OK;
1106 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1108 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1110 TRACE("iface %p, visual %p.\n", iface, visual);
1112 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1115 static HRESULT WINAPI d3drm_frame1_AddVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1117 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1119 TRACE("iface %p, visual %p.\n", iface, visual);
1121 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1124 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1126 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1127 struct d3drm_frame_array *array;
1129 TRACE("iface %p, children %p.\n", iface, children);
1131 if (!children)
1132 return D3DRMERR_BADVALUE;
1134 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1135 return E_OUTOFMEMORY;
1137 *children = &array->IDirect3DRMFrameArray_iface;
1139 return D3DRM_OK;
1142 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
1144 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1146 TRACE("iface %p, children %p.\n", iface, children);
1148 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1151 static HRESULT WINAPI d3drm_frame1_GetChildren(IDirect3DRMFrame *iface, IDirect3DRMFrameArray **children)
1153 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1155 TRACE("iface %p, children %p.\n", iface, children);
1157 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1160 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1162 FIXME("iface %p stub!\n", iface);
1164 return 0;
1167 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
1169 FIXME("iface %p stub!\n", iface);
1171 return 0;
1174 static D3DCOLOR WINAPI d3drm_frame1_GetColor(IDirect3DRMFrame *iface)
1176 FIXME("iface %p stub!\n", iface);
1178 return 0;
1181 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1183 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1184 struct d3drm_light_array *array;
1186 TRACE("iface %p, lights %p.\n", iface, lights);
1188 if (!lights)
1189 return D3DRMERR_BADVALUE;
1191 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1192 return E_OUTOFMEMORY;
1194 *lights = &array->IDirect3DRMLightArray_iface;
1196 return D3DRM_OK;
1199 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
1201 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1203 TRACE("iface %p, lights %p.\n", iface, lights);
1205 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1208 static HRESULT WINAPI d3drm_frame1_GetLights(IDirect3DRMFrame *iface, IDirect3DRMLightArray **lights)
1210 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1212 TRACE("iface %p, lights %p.\n", iface, lights);
1214 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1217 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1219 FIXME("iface %p stub!\n", iface);
1221 return D3DRMMATERIAL_FROMPARENT;
1224 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
1226 FIXME("iface %p stub!\n", iface);
1228 return D3DRMMATERIAL_FROMPARENT;
1231 static D3DRMMATERIALMODE WINAPI d3drm_frame1_GetMaterialMode(IDirect3DRMFrame *iface)
1233 FIXME("iface %p stub!\n", iface);
1235 return D3DRMMATERIAL_FROMPARENT;
1238 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1240 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1242 TRACE("iface %p, parent %p.\n", iface, parent);
1244 if (!parent)
1245 return D3DRMERR_BADVALUE;
1247 if (frame->parent)
1249 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1250 IDirect3DRMFrame_AddRef(*parent);
1252 else
1254 *parent = NULL;
1257 return D3DRM_OK;
1260 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
1262 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1264 TRACE("iface %p, parent %p.\n", iface, parent);
1266 if (!parent)
1267 return D3DRMERR_BADVALUE;
1269 if (frame->parent)
1271 *parent = &frame->parent->IDirect3DRMFrame_iface;
1272 IDirect3DRMFrame_AddRef(*parent);
1274 else
1276 *parent = NULL;
1279 return D3DRM_OK;
1282 static HRESULT WINAPI d3drm_frame1_GetParent(IDirect3DRMFrame *iface, IDirect3DRMFrame **parent)
1284 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1286 TRACE("iface %p, parent %p.\n", iface, parent);
1288 return d3drm_frame2_GetParent(&frame->IDirect3DRMFrame2_iface, parent);
1291 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1292 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1294 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1296 return E_NOTIMPL;
1299 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
1300 IDirect3DRMFrame *reference, D3DVECTOR *position)
1302 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1304 return E_NOTIMPL;
1307 static HRESULT WINAPI d3drm_frame1_GetPosition(IDirect3DRMFrame *iface,
1308 IDirect3DRMFrame *reference, D3DVECTOR *position)
1310 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1312 return E_NOTIMPL;
1316 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1317 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1319 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1321 return E_NOTIMPL;
1324 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
1325 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1327 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1329 return E_NOTIMPL;
1332 static HRESULT WINAPI d3drm_frame1_GetRotation(IDirect3DRMFrame *iface,
1333 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1335 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1337 return E_NOTIMPL;
1340 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1342 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1344 TRACE("iface %p, scene %p.\n", iface, scene);
1346 if (!scene)
1347 return D3DRMERR_BADVALUE;
1349 while (frame->parent)
1350 frame = frame->parent;
1352 *scene = &frame->IDirect3DRMFrame3_iface;
1353 IDirect3DRMFrame3_AddRef(*scene);
1355 return D3DRM_OK;
1358 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
1360 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1361 IDirect3DRMFrame3 *frame3;
1362 HRESULT hr;
1364 TRACE("iface %p, scene %p.\n", iface, scene);
1366 if (!scene)
1367 return D3DRMERR_BADVALUE;
1369 hr = IDirect3DRMFrame3_GetScene(&frame->IDirect3DRMFrame3_iface, &frame3);
1370 if (FAILED(hr) || !frame3)
1372 *scene = NULL;
1373 return hr;
1376 hr = IDirect3DRMFrame3_QueryInterface(frame3, &IID_IDirect3DRMFrame, (void **)scene);
1377 IDirect3DRMFrame3_Release(frame3);
1379 return hr;
1382 static HRESULT WINAPI d3drm_frame1_GetScene(IDirect3DRMFrame *iface, IDirect3DRMFrame **scene)
1384 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1386 TRACE("iface %p, scene %p.\n", iface, scene);
1388 return d3drm_frame2_GetScene(&frame->IDirect3DRMFrame2_iface, scene);
1391 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1393 FIXME("iface %p stub!\n", iface);
1395 return D3DRMSORT_FROMPARENT;
1398 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
1400 FIXME("iface %p stub!\n", iface);
1402 return D3DRMSORT_FROMPARENT;
1405 static D3DRMSORTMODE WINAPI d3drm_frame1_GetSortMode(IDirect3DRMFrame *iface)
1407 FIXME("iface %p stub!\n", iface);
1409 return D3DRMSORT_FROMPARENT;
1412 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1414 FIXME("iface %p, texture %p stub!\n", iface, texture);
1416 return E_NOTIMPL;
1419 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
1421 FIXME("iface %p, texture %p stub!\n", iface, texture);
1423 return E_NOTIMPL;
1426 static HRESULT WINAPI d3drm_frame1_GetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture **texture)
1428 FIXME("iface %p, texture %p stub!\n", iface, texture);
1430 return E_NOTIMPL;
1433 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1434 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1436 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1438 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1440 if (reference)
1441 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1443 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1445 return D3DRM_OK;
1448 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
1450 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1452 TRACE("iface %p, matrix %p.\n", iface, matrix);
1454 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1456 return D3DRM_OK;
1459 static HRESULT WINAPI d3drm_frame1_GetTransform(IDirect3DRMFrame *iface, D3DRMMATRIX4D matrix)
1461 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1463 TRACE("iface %p, matrix %p.\n", iface, matrix);
1465 return d3drm_frame2_GetTransform(&frame->IDirect3DRMFrame2_iface, matrix);
1468 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1469 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1471 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1472 iface, reference, velocity, with_rotation);
1474 return E_NOTIMPL;
1477 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
1478 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1480 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1481 iface, reference, velocity, with_rotation);
1483 return E_NOTIMPL;
1486 static HRESULT WINAPI d3drm_frame1_GetVelocity(IDirect3DRMFrame *iface,
1487 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1489 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1490 iface, reference, velocity, with_rotation);
1492 return E_NOTIMPL;
1495 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1496 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1498 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1500 return E_NOTIMPL;
1503 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
1504 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1506 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1508 return E_NOTIMPL;
1511 static HRESULT WINAPI d3drm_frame1_GetOrientation(IDirect3DRMFrame *iface,
1512 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1514 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1516 return E_NOTIMPL;
1519 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface, DWORD *count, IUnknown **visuals)
1521 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1523 return E_NOTIMPL;
1526 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
1528 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1529 struct d3drm_visual_array *array;
1531 TRACE("iface %p, visuals %p.\n", iface, visuals);
1533 if (!visuals)
1534 return D3DRMERR_BADVALUE;
1536 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
1537 return E_OUTOFMEMORY;
1539 *visuals = &array->IDirect3DRMVisualArray_iface;
1541 return D3DRM_OK;
1544 static HRESULT WINAPI d3drm_frame1_GetVisuals(IDirect3DRMFrame *iface, IDirect3DRMVisualArray **visuals)
1546 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1548 TRACE("iface %p, visuals %p.\n", iface, visuals);
1550 return d3drm_frame2_GetVisuals(&frame->IDirect3DRMFrame2_iface, visuals);
1553 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
1555 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1557 return E_NOTIMPL;
1560 static HRESULT WINAPI d3drm_frame1_GetTextureTopology(IDirect3DRMFrame *iface, BOOL *wrap_u, BOOL *wrap_v)
1562 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1564 return E_NOTIMPL;
1567 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1569 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1571 return E_NOTIMPL;
1574 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1576 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1578 return E_NOTIMPL;
1581 static HRESULT WINAPI d3drm_frame1_InverseTransform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
1583 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1585 return E_NOTIMPL;
1588 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1589 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1591 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1592 iface, filename, name, flags, cb, ctx);
1594 return E_NOTIMPL;
1597 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
1598 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1600 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1601 iface, filename, name, flags, cb, ctx);
1603 return E_NOTIMPL;
1606 static HRESULT WINAPI d3drm_frame1_Load(IDirect3DRMFrame *iface, void *filename,
1607 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1609 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1610 iface, filename, name, flags, cb, ctx);
1612 return E_NOTIMPL;
1615 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1616 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1618 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1620 return E_NOTIMPL;
1623 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
1624 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1626 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1628 return E_NOTIMPL;
1631 static HRESULT WINAPI d3drm_frame1_LookAt(IDirect3DRMFrame *iface, IDirect3DRMFrame *target,
1632 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1634 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1636 return E_NOTIMPL;
1639 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1641 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1643 return E_NOTIMPL;
1646 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
1648 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1650 return E_NOTIMPL;
1653 static HRESULT WINAPI d3drm_frame1_Move(IDirect3DRMFrame *iface, D3DVALUE delta)
1655 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1657 return E_NOTIMPL;
1660 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1662 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1663 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1664 ULONG i;
1666 TRACE("iface %p, child %p.\n", iface, child);
1668 if (!child_impl)
1669 return D3DRMERR_BADOBJECT;
1671 /* Check if child exists */
1672 for (i = 0; i < frame->nb_children; ++i)
1674 if (frame->children[i] == child)
1675 break;
1678 if (i == frame->nb_children)
1679 return D3DRMERR_BADVALUE;
1681 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1682 IDirect3DRMFrame3_Release(child);
1683 child_impl->parent = NULL;
1684 --frame->nb_children;
1686 return D3DRM_OK;
1689 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
1691 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1692 IDirect3DRMFrame3 *child3;
1693 HRESULT hr;
1695 TRACE("iface %p, child %p.\n", iface, child);
1697 if (!child)
1698 return D3DRMERR_BADOBJECT;
1699 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
1700 return D3DRMERR_BADOBJECT;
1701 IDirect3DRMFrame_Release(child);
1703 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
1706 static HRESULT WINAPI d3drm_frame1_DeleteChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
1708 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1709 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
1711 TRACE("iface %p, child %p.\n", iface, child);
1713 if (!child_frame)
1714 return D3DRMERR_BADOBJECT;
1716 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
1719 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1721 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1722 ULONG i;
1724 TRACE("iface %p, light %p.\n", iface, light);
1726 if (!light)
1727 return D3DRMERR_BADOBJECT;
1729 /* Check if visual exists */
1730 for (i = 0; i < frame->nb_lights; ++i)
1732 if (frame->lights[i] == light)
1733 break;
1736 if (i == frame->nb_lights)
1737 return D3DRMERR_BADVALUE;
1739 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1740 IDirect3DRMLight_Release(light);
1741 --frame->nb_lights;
1743 return D3DRM_OK;
1746 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
1748 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1750 TRACE("iface %p, light %p.\n", iface, light);
1752 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1755 static HRESULT WINAPI d3drm_frame1_DeleteLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
1757 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1759 TRACE("iface %p, light %p.\n", iface, light);
1761 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1764 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1765 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1767 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1769 return E_NOTIMPL;
1772 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
1773 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1775 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1777 return E_NOTIMPL;
1780 static HRESULT WINAPI d3drm_frame1_DeleteMoveCallback(IDirect3DRMFrame *iface,
1781 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1783 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1785 return E_NOTIMPL;
1788 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1790 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1791 ULONG i;
1793 TRACE("iface %p, visual %p.\n", iface, visual);
1795 if (!visual)
1796 return D3DRMERR_BADOBJECT;
1798 /* Check if visual exists */
1799 for (i = 0; i < frame->nb_visuals; ++i)
1801 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1802 break;
1805 if (i == frame->nb_visuals)
1806 return D3DRMERR_BADVALUE;
1808 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1809 IDirect3DRMVisual_Release(visual);
1810 --frame->nb_visuals;
1812 return D3DRM_OK;
1815 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1817 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1819 TRACE("iface %p, visual %p.\n", iface, visual);
1821 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1824 static HRESULT WINAPI d3drm_frame1_DeleteVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1826 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1828 TRACE("iface %p, visual %p.\n", iface, visual);
1830 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1833 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1835 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1837 TRACE("iface %p.\n", iface);
1839 return frame->scenebackground;
1842 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
1844 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1846 TRACE("iface %p.\n", iface);
1848 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1851 static D3DCOLOR WINAPI d3drm_frame1_GetSceneBackground(IDirect3DRMFrame *iface)
1853 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1855 TRACE("iface %p.\n", iface);
1857 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1860 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1861 IDirectDrawSurface **surface)
1863 FIXME("iface %p, surface %p stub!\n", iface, surface);
1865 return E_NOTIMPL;
1868 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
1869 IDirectDrawSurface **surface)
1871 FIXME("iface %p, surface %p stub!\n", iface, surface);
1873 return E_NOTIMPL;
1876 static HRESULT WINAPI d3drm_frame1_GetSceneBackgroundDepth(IDirect3DRMFrame *iface,
1877 IDirectDrawSurface **surface)
1879 FIXME("iface %p, surface %p stub!\n", iface, surface);
1881 return E_NOTIMPL;
1884 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1886 FIXME("iface %p stub!\n", iface);
1888 return 0;
1891 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
1893 FIXME("iface %p stub!\n", iface);
1895 return 0;
1898 static D3DCOLOR WINAPI d3drm_frame1_GetSceneFogColor(IDirect3DRMFrame *iface)
1900 FIXME("iface %p stub!\n", iface);
1902 return 0;
1905 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1907 FIXME("iface %p stub!\n", iface);
1909 return FALSE;
1912 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
1914 FIXME("iface %p stub!\n", iface);
1916 return FALSE;
1919 static BOOL WINAPI d3drm_frame1_GetSceneFogEnable(IDirect3DRMFrame *iface)
1921 FIXME("iface %p stub!\n", iface);
1923 return FALSE;
1926 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1928 FIXME("iface %p stub!\n", iface);
1930 return D3DRMFOG_LINEAR;
1933 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
1935 FIXME("iface %p stub!\n", iface);
1937 return D3DRMFOG_LINEAR;
1940 static D3DRMFOGMODE WINAPI d3drm_frame1_GetSceneFogMode(IDirect3DRMFrame *iface)
1942 FIXME("iface %p stub!\n", iface);
1944 return D3DRMFOG_LINEAR;
1947 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1948 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1950 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1952 return E_NOTIMPL;
1955 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
1956 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1958 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1960 return E_NOTIMPL;
1963 static HRESULT WINAPI d3drm_frame1_GetSceneFogParams(IDirect3DRMFrame *iface,
1964 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1966 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1968 return E_NOTIMPL;
1971 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1973 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1975 TRACE("iface %p, color 0x%08x.\n", iface, color);
1977 frame->scenebackground = color;
1979 return D3DRM_OK;
1982 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
1984 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1986 TRACE("iface %p, color 0x%08x.\n", iface, color);
1988 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1991 static HRESULT WINAPI d3drm_frame1_SetSceneBackground(IDirect3DRMFrame *iface, D3DCOLOR color)
1993 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1995 TRACE("iface %p, color 0x%08x.\n", iface, color);
1997 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
2000 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
2001 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2003 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
2005 TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2007 frame->scenebackground = RGBA_MAKE((BYTE)(red * 255.0f),
2008 (BYTE)(green * 255.0f), (BYTE)(blue * 255.0f), 0xff);
2010 return D3DRM_OK;
2013 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
2014 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2016 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
2018 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2020 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2023 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundRGB(IDirect3DRMFrame *iface,
2024 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2026 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
2028 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2030 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2033 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
2034 IDirectDrawSurface *surface)
2036 FIXME("iface %p, surface %p stub!\n", iface, surface);
2038 return E_NOTIMPL;
2041 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
2042 IDirectDrawSurface *surface)
2044 FIXME("iface %p, surface %p stub!\n", iface, surface);
2046 return E_NOTIMPL;
2049 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *iface,
2050 IDirectDrawSurface *surface)
2052 FIXME("iface %p, surface %p stub!\n", iface, surface);
2054 return E_NOTIMPL;
2057 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
2058 IDirect3DRMTexture3 *texture)
2060 FIXME("iface %p, texture %p stub!\n", iface, texture);
2062 return E_NOTIMPL;
2065 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
2066 IDirect3DRMTexture *texture)
2068 FIXME("iface %p, texture %p stub!\n", iface, texture);
2070 return E_NOTIMPL;
2073 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface,
2074 IDirect3DRMTexture *texture)
2076 FIXME("iface %p, texture %p stub!\n", iface, texture);
2078 return E_NOTIMPL;
2081 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2083 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2085 return E_NOTIMPL;
2088 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
2090 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2092 return E_NOTIMPL;
2095 static HRESULT WINAPI d3drm_frame1_SetSceneFogEnable(IDirect3DRMFrame *iface, BOOL enable)
2097 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2099 return E_NOTIMPL;
2102 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2104 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2106 return E_NOTIMPL;
2109 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2111 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2113 return E_NOTIMPL;
2116 static HRESULT WINAPI d3drm_frame1_SetSceneFogColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2118 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2120 return E_NOTIMPL;
2123 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
2125 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2127 return E_NOTIMPL;
2130 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
2132 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2134 return E_NOTIMPL;
2137 static HRESULT WINAPI d3drm_frame1_SetSceneFogMode(IDirect3DRMFrame *iface, D3DRMFOGMODE mode)
2139 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2141 return E_NOTIMPL;
2144 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
2145 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2147 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2149 return E_NOTIMPL;
2152 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
2153 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2155 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2157 return E_NOTIMPL;
2160 static HRESULT WINAPI d3drm_frame1_SetSceneFogParams(IDirect3DRMFrame *iface,
2161 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2163 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2165 return E_NOTIMPL;
2168 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2170 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2172 return E_NOTIMPL;
2175 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2177 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2179 return E_NOTIMPL;
2182 static HRESULT WINAPI d3drm_frame1_SetColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2184 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2186 return E_NOTIMPL;
2189 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
2190 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2192 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2194 return E_NOTIMPL;
2197 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
2198 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2200 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2202 return E_NOTIMPL;
2205 static HRESULT WINAPI d3drm_frame1_SetColorRGB(IDirect3DRMFrame *iface,
2206 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2208 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2210 return E_NOTIMPL;
2213 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
2215 FIXME("iface %p stub!\n", iface);
2217 return D3DRMZBUFFER_FROMPARENT;
2220 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
2222 FIXME("iface %p stub!\n", iface);
2224 return D3DRMZBUFFER_FROMPARENT;
2227 static D3DRMZBUFFERMODE WINAPI d3drm_frame1_GetZbufferMode(IDirect3DRMFrame *iface)
2229 FIXME("iface %p stub!\n", iface);
2231 return D3DRMZBUFFER_FROMPARENT;
2234 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
2236 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2238 return E_NOTIMPL;
2241 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
2243 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2245 return E_NOTIMPL;
2248 static HRESULT WINAPI d3drm_frame1_SetMaterialMode(IDirect3DRMFrame *iface, D3DRMMATERIALMODE mode)
2250 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2252 return E_NOTIMPL;
2255 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2256 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2258 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2259 iface, reference, dx, dy, dz, ux, uy, uz);
2261 return E_NOTIMPL;
2264 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
2265 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2267 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2268 iface, reference, dx, dy, dz, ux, uy, uz);
2270 return E_NOTIMPL;
2273 static HRESULT WINAPI d3drm_frame1_SetOrientation(IDirect3DRMFrame *iface, IDirect3DRMFrame *reference,
2274 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2276 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2277 iface, reference, dx, dy, dz, ux, uy, uz);
2279 return E_NOTIMPL;
2282 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
2283 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2285 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2287 return E_NOTIMPL;
2290 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
2291 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2293 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2295 return E_NOTIMPL;
2298 static HRESULT WINAPI d3drm_frame1_SetPosition(IDirect3DRMFrame *iface,
2299 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2301 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2303 return E_NOTIMPL;
2306 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
2307 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2309 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2310 iface, reference, x, y, z, theta);
2312 return E_NOTIMPL;
2315 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
2316 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2318 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2319 iface, reference, x, y, z, theta);
2321 return E_NOTIMPL;
2324 static HRESULT WINAPI d3drm_frame1_SetRotation(IDirect3DRMFrame *iface,
2325 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2327 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2328 iface, reference, x, y, z, theta);
2330 return E_NOTIMPL;
2333 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
2335 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2337 return E_NOTIMPL;
2340 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
2342 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2344 return E_NOTIMPL;
2347 static HRESULT WINAPI d3drm_frame1_SetSortMode(IDirect3DRMFrame *iface, D3DRMSORTMODE mode)
2349 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2351 return E_NOTIMPL;
2354 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
2356 FIXME("iface %p, texture %p stub!\n", iface, texture);
2358 return E_NOTIMPL;
2361 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
2363 FIXME("iface %p, texture %p stub!\n", iface, texture);
2365 return E_NOTIMPL;
2368 static HRESULT WINAPI d3drm_frame1_SetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
2370 FIXME("iface %p, texture %p stub!\n", iface, texture);
2372 return E_NOTIMPL;
2375 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
2377 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2379 return E_NOTIMPL;
2382 static HRESULT WINAPI d3drm_frame1_SetTextureTopology(IDirect3DRMFrame *iface, BOOL wrap_u, BOOL wrap_v)
2384 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2386 return E_NOTIMPL;
2389 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
2390 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2392 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
2393 iface, reference, x, y, z, with_rotation);
2395 return E_NOTIMPL;
2398 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
2399 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2401 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2402 iface, reference, x, y, z, with_rotation);
2404 return E_NOTIMPL;
2407 static HRESULT WINAPI d3drm_frame1_SetVelocity(IDirect3DRMFrame *iface,
2408 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2410 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2411 iface, reference, x, y, z, with_rotation);
2413 return E_NOTIMPL;
2416 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
2418 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2420 return E_NOTIMPL;
2423 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
2425 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2427 return E_NOTIMPL;
2430 static HRESULT WINAPI d3drm_frame1_SetZbufferMode(IDirect3DRMFrame *iface, D3DRMZBUFFERMODE mode)
2432 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2434 return E_NOTIMPL;
2437 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
2439 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2441 return E_NOTIMPL;
2444 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
2446 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2448 return E_NOTIMPL;
2451 static HRESULT WINAPI d3drm_frame1_Transform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
2453 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2455 return E_NOTIMPL;
2458 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
2459 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
2461 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
2463 return E_NOTIMPL;
2466 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2468 FIXME("iface %p, box %p stub!\n", iface, box);
2470 return E_NOTIMPL;
2473 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2475 FIXME("iface %p, box %p stub!\n", iface, box);
2477 return E_NOTIMPL;
2480 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2482 FIXME("iface %p stub!\n", iface);
2484 return FALSE;
2487 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
2489 FIXME("iface %p stub!\n", iface);
2491 return FALSE;
2494 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2496 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2498 return E_NOTIMPL;
2501 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2503 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2505 return E_NOTIMPL;
2508 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2510 FIXME("iface %p, material %p stub!\n", iface, material);
2512 return E_NOTIMPL;
2515 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
2517 FIXME("iface %p, material %p stub!\n", iface, material);
2519 return E_NOTIMPL;
2522 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2524 FIXME("iface %p stub!\n", iface);
2526 return FALSE;
2529 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
2531 FIXME("iface %p stub!\n", iface);
2533 return FALSE;
2536 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2538 FIXME("iface %p, box %p stub!\n", iface, box);
2540 return E_NOTIMPL;
2543 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2545 FIXME("iface %p, box %p stub!\n", iface, box);
2547 return E_NOTIMPL;
2550 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2552 FIXME("iface %p, box %p stub!\n", iface, box);
2554 return E_NOTIMPL;
2557 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2559 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2561 return E_NOTIMPL;
2564 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2565 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2567 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2568 iface, dx, dy, dz, ux, uy, uz);
2570 return E_NOTIMPL;
2573 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2575 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2577 return E_NOTIMPL;
2580 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2582 FIXME("iface %p, material %p stub!\n", iface, material);
2584 return E_NOTIMPL;
2587 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2588 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2590 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2592 return E_NOTIMPL;
2595 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2596 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2598 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2599 iface, reference, ray, flags, visuals);
2601 return E_NOTIMPL;
2604 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2605 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2607 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2608 iface, debugstr_a(filename), format, flags);
2610 return E_NOTIMPL;
2613 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2614 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2616 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2618 return E_NOTIMPL;
2621 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2622 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2624 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2626 return E_NOTIMPL;
2629 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags)
2631 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2633 return E_NOTIMPL;
2636 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2638 FIXME("iface %p, flags %p stub!\n", iface, flags);
2640 return E_NOTIMPL;
2643 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2645 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2647 return E_NOTIMPL;
2650 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2652 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2654 return E_NOTIMPL;
2657 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2658 D3DRMMATERIALOVERRIDE *override)
2660 FIXME("iface %p, override %p stub!\n", iface, override);
2662 return E_NOTIMPL;
2665 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2666 D3DRMMATERIALOVERRIDE *override)
2668 FIXME("iface %p, override %p stub!\n", iface, override);
2670 return E_NOTIMPL;
2673 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2675 d3drm_frame3_QueryInterface,
2676 d3drm_frame3_AddRef,
2677 d3drm_frame3_Release,
2678 d3drm_frame3_Clone,
2679 d3drm_frame3_AddDestroyCallback,
2680 d3drm_frame3_DeleteDestroyCallback,
2681 d3drm_frame3_SetAppData,
2682 d3drm_frame3_GetAppData,
2683 d3drm_frame3_SetName,
2684 d3drm_frame3_GetName,
2685 d3drm_frame3_GetClassName,
2686 d3drm_frame3_AddChild,
2687 d3drm_frame3_AddLight,
2688 d3drm_frame3_AddMoveCallback,
2689 d3drm_frame3_AddTransform,
2690 d3drm_frame3_AddTranslation,
2691 d3drm_frame3_AddScale,
2692 d3drm_frame3_AddRotation,
2693 d3drm_frame3_AddVisual,
2694 d3drm_frame3_GetChildren,
2695 d3drm_frame3_GetColor,
2696 d3drm_frame3_GetLights,
2697 d3drm_frame3_GetMaterialMode,
2698 d3drm_frame3_GetParent,
2699 d3drm_frame3_GetPosition,
2700 d3drm_frame3_GetRotation,
2701 d3drm_frame3_GetScene,
2702 d3drm_frame3_GetSortMode,
2703 d3drm_frame3_GetTexture,
2704 d3drm_frame3_GetTransform,
2705 d3drm_frame3_GetVelocity,
2706 d3drm_frame3_GetOrientation,
2707 d3drm_frame3_GetVisuals,
2708 d3drm_frame3_InverseTransform,
2709 d3drm_frame3_Load,
2710 d3drm_frame3_LookAt,
2711 d3drm_frame3_Move,
2712 d3drm_frame3_DeleteChild,
2713 d3drm_frame3_DeleteLight,
2714 d3drm_frame3_DeleteMoveCallback,
2715 d3drm_frame3_DeleteVisual,
2716 d3drm_frame3_GetSceneBackground,
2717 d3drm_frame3_GetSceneBackgroundDepth,
2718 d3drm_frame3_GetSceneFogColor,
2719 d3drm_frame3_GetSceneFogEnable,
2720 d3drm_frame3_GetSceneFogMode,
2721 d3drm_frame3_GetSceneFogParams,
2722 d3drm_frame3_SetSceneBackground,
2723 d3drm_frame3_SetSceneBackgroundRGB,
2724 d3drm_frame3_SetSceneBackgroundDepth,
2725 d3drm_frame3_SetSceneBackgroundImage,
2726 d3drm_frame3_SetSceneFogEnable,
2727 d3drm_frame3_SetSceneFogColor,
2728 d3drm_frame3_SetSceneFogMode,
2729 d3drm_frame3_SetSceneFogParams,
2730 d3drm_frame3_SetColor,
2731 d3drm_frame3_SetColorRGB,
2732 d3drm_frame3_GetZbufferMode,
2733 d3drm_frame3_SetMaterialMode,
2734 d3drm_frame3_SetOrientation,
2735 d3drm_frame3_SetPosition,
2736 d3drm_frame3_SetRotation,
2737 d3drm_frame3_SetSortMode,
2738 d3drm_frame3_SetTexture,
2739 d3drm_frame3_SetVelocity,
2740 d3drm_frame3_SetZbufferMode,
2741 d3drm_frame3_Transform,
2742 d3drm_frame3_GetBox,
2743 d3drm_frame3_GetBoxEnable,
2744 d3drm_frame3_GetAxes,
2745 d3drm_frame3_GetMaterial,
2746 d3drm_frame3_GetInheritAxes,
2747 d3drm_frame3_GetHierarchyBox,
2748 d3drm_frame3_SetBox,
2749 d3drm_frame3_SetBoxEnable,
2750 d3drm_frame3_SetAxes,
2751 d3drm_frame3_SetInheritAxes,
2752 d3drm_frame3_SetMaterial,
2753 d3drm_frame3_SetQuaternion,
2754 d3drm_frame3_RayPick,
2755 d3drm_frame3_Save,
2756 d3drm_frame3_TransformVectors,
2757 d3drm_frame3_InverseTransformVectors,
2758 d3drm_frame3_SetTraversalOptions,
2759 d3drm_frame3_GetTraversalOptions,
2760 d3drm_frame3_SetSceneFogMethod,
2761 d3drm_frame3_GetSceneFogMethod,
2762 d3drm_frame3_SetMaterialOverride,
2763 d3drm_frame3_GetMaterialOverride,
2766 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
2768 d3drm_frame2_QueryInterface,
2769 d3drm_frame2_AddRef,
2770 d3drm_frame2_Release,
2771 d3drm_frame2_Clone,
2772 d3drm_frame2_AddDestroyCallback,
2773 d3drm_frame2_DeleteDestroyCallback,
2774 d3drm_frame2_SetAppData,
2775 d3drm_frame2_GetAppData,
2776 d3drm_frame2_SetName,
2777 d3drm_frame2_GetName,
2778 d3drm_frame2_GetClassName,
2779 d3drm_frame2_AddChild,
2780 d3drm_frame2_AddLight,
2781 d3drm_frame2_AddMoveCallback,
2782 d3drm_frame2_AddTransform,
2783 d3drm_frame2_AddTranslation,
2784 d3drm_frame2_AddScale,
2785 d3drm_frame2_AddRotation,
2786 d3drm_frame2_AddVisual,
2787 d3drm_frame2_GetChildren,
2788 d3drm_frame2_GetColor,
2789 d3drm_frame2_GetLights,
2790 d3drm_frame2_GetMaterialMode,
2791 d3drm_frame2_GetParent,
2792 d3drm_frame2_GetPosition,
2793 d3drm_frame2_GetRotation,
2794 d3drm_frame2_GetScene,
2795 d3drm_frame2_GetSortMode,
2796 d3drm_frame2_GetTexture,
2797 d3drm_frame2_GetTransform,
2798 d3drm_frame2_GetVelocity,
2799 d3drm_frame2_GetOrientation,
2800 d3drm_frame2_GetVisuals,
2801 d3drm_frame2_GetTextureTopology,
2802 d3drm_frame2_InverseTransform,
2803 d3drm_frame2_Load,
2804 d3drm_frame2_LookAt,
2805 d3drm_frame2_Move,
2806 d3drm_frame2_DeleteChild,
2807 d3drm_frame2_DeleteLight,
2808 d3drm_frame2_DeleteMoveCallback,
2809 d3drm_frame2_DeleteVisual,
2810 d3drm_frame2_GetSceneBackground,
2811 d3drm_frame2_GetSceneBackgroundDepth,
2812 d3drm_frame2_GetSceneFogColor,
2813 d3drm_frame2_GetSceneFogEnable,
2814 d3drm_frame2_GetSceneFogMode,
2815 d3drm_frame2_GetSceneFogParams,
2816 d3drm_frame2_SetSceneBackground,
2817 d3drm_frame2_SetSceneBackgroundRGB,
2818 d3drm_frame2_SetSceneBackgroundDepth,
2819 d3drm_frame2_SetSceneBackgroundImage,
2820 d3drm_frame2_SetSceneFogEnable,
2821 d3drm_frame2_SetSceneFogColor,
2822 d3drm_frame2_SetSceneFogMode,
2823 d3drm_frame2_SetSceneFogParams,
2824 d3drm_frame2_SetColor,
2825 d3drm_frame2_SetColorRGB,
2826 d3drm_frame2_GetZbufferMode,
2827 d3drm_frame2_SetMaterialMode,
2828 d3drm_frame2_SetOrientation,
2829 d3drm_frame2_SetPosition,
2830 d3drm_frame2_SetRotation,
2831 d3drm_frame2_SetSortMode,
2832 d3drm_frame2_SetTexture,
2833 d3drm_frame2_SetTextureTopology,
2834 d3drm_frame2_SetVelocity,
2835 d3drm_frame2_SetZbufferMode,
2836 d3drm_frame2_Transform,
2837 d3drm_frame2_AddMoveCallback2,
2838 d3drm_frame2_GetBox,
2839 d3drm_frame2_GetBoxEnable,
2840 d3drm_frame2_GetAxes,
2841 d3drm_frame2_GetMaterial,
2842 d3drm_frame2_GetInheritAxes,
2843 d3drm_frame2_GetHierarchyBox,
2846 static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl =
2848 d3drm_frame1_QueryInterface,
2849 d3drm_frame1_AddRef,
2850 d3drm_frame1_Release,
2851 d3drm_frame1_Clone,
2852 d3drm_frame1_AddDestroyCallback,
2853 d3drm_frame1_DeleteDestroyCallback,
2854 d3drm_frame1_SetAppData,
2855 d3drm_frame1_GetAppData,
2856 d3drm_frame1_SetName,
2857 d3drm_frame1_GetName,
2858 d3drm_frame1_GetClassName,
2859 d3drm_frame1_AddChild,
2860 d3drm_frame1_AddLight,
2861 d3drm_frame1_AddMoveCallback,
2862 d3drm_frame1_AddTransform,
2863 d3drm_frame1_AddTranslation,
2864 d3drm_frame1_AddScale,
2865 d3drm_frame1_AddRotation,
2866 d3drm_frame1_AddVisual,
2867 d3drm_frame1_GetChildren,
2868 d3drm_frame1_GetColor,
2869 d3drm_frame1_GetLights,
2870 d3drm_frame1_GetMaterialMode,
2871 d3drm_frame1_GetParent,
2872 d3drm_frame1_GetPosition,
2873 d3drm_frame1_GetRotation,
2874 d3drm_frame1_GetScene,
2875 d3drm_frame1_GetSortMode,
2876 d3drm_frame1_GetTexture,
2877 d3drm_frame1_GetTransform,
2878 d3drm_frame1_GetVelocity,
2879 d3drm_frame1_GetOrientation,
2880 d3drm_frame1_GetVisuals,
2881 d3drm_frame1_GetTextureTopology,
2882 d3drm_frame1_InverseTransform,
2883 d3drm_frame1_Load,
2884 d3drm_frame1_LookAt,
2885 d3drm_frame1_Move,
2886 d3drm_frame1_DeleteChild,
2887 d3drm_frame1_DeleteLight,
2888 d3drm_frame1_DeleteMoveCallback,
2889 d3drm_frame1_DeleteVisual,
2890 d3drm_frame1_GetSceneBackground,
2891 d3drm_frame1_GetSceneBackgroundDepth,
2892 d3drm_frame1_GetSceneFogColor,
2893 d3drm_frame1_GetSceneFogEnable,
2894 d3drm_frame1_GetSceneFogMode,
2895 d3drm_frame1_GetSceneFogParams,
2896 d3drm_frame1_SetSceneBackground,
2897 d3drm_frame1_SetSceneBackgroundRGB,
2898 d3drm_frame1_SetSceneBackgroundDepth,
2899 d3drm_frame1_SetSceneBackgroundImage,
2900 d3drm_frame1_SetSceneFogEnable,
2901 d3drm_frame1_SetSceneFogColor,
2902 d3drm_frame1_SetSceneFogMode,
2903 d3drm_frame1_SetSceneFogParams,
2904 d3drm_frame1_SetColor,
2905 d3drm_frame1_SetColorRGB,
2906 d3drm_frame1_GetZbufferMode,
2907 d3drm_frame1_SetMaterialMode,
2908 d3drm_frame1_SetOrientation,
2909 d3drm_frame1_SetPosition,
2910 d3drm_frame1_SetRotation,
2911 d3drm_frame1_SetSortMode,
2912 d3drm_frame1_SetTexture,
2913 d3drm_frame1_SetTextureTopology,
2914 d3drm_frame1_SetVelocity,
2915 d3drm_frame1_SetZbufferMode,
2916 d3drm_frame1_Transform,
2919 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2921 if (!iface)
2922 return NULL;
2923 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2925 return impl_from_IDirect3DRMFrame3(iface);
2928 struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
2930 if (!iface)
2931 return NULL;
2932 assert(iface->lpVtbl == &d3drm_frame1_vtbl);
2934 return impl_from_IDirect3DRMFrame(iface);
2937 HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm)
2939 struct d3drm_frame *object;
2940 HRESULT hr = D3DRM_OK;
2942 TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
2944 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
2945 return E_OUTOFMEMORY;
2947 object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
2948 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2949 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2950 object->d3drm = d3drm;
2951 object->ref = 1;
2952 object->scenebackground = RGBA_MAKE(0, 0, 0, 0xff);
2954 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2956 if (parent_frame)
2958 IDirect3DRMFrame3 *p;
2960 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
2962 HeapFree(GetProcessHeap(), 0, object);
2963 return hr;
2965 IDirect3DRMFrame_Release(parent_frame);
2966 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2969 *frame = object;
2971 return hr;