d3dx9: Dump preshader immediates table.
[wine.git] / dlls / d3drm / frame.c
blob2758ec63ad4f348ab41a3ed9c38aa62cb47138e7
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 "config.h"
23 #include "wine/port.h"
25 #include "d3drm_private.h"
27 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
29 static D3DRMMATRIX4D identity = {
30 { 1.0f, 0.0f, 0.0f, 0.0f },
31 { 0.0f, 1.0f, 0.0f, 0.0f },
32 { 0.0f, 0.0f, 1.0f, 0.0f },
33 { 0.0f, 0.0f, 0.0f, 1.0f }
36 struct d3drm_frame_array
38 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface;
39 LONG ref;
40 ULONG size;
41 IDirect3DRMFrame **frames;
44 struct d3drm_visual_array
46 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface;
47 LONG ref;
48 ULONG size;
49 IDirect3DRMVisual **visuals;
52 struct d3drm_light_array
54 IDirect3DRMLightArray IDirect3DRMLightArray_iface;
55 LONG ref;
56 ULONG size;
57 IDirect3DRMLight **lights;
60 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
62 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame_iface);
65 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
67 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame2_iface);
70 static inline struct d3drm_frame *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
72 return CONTAINING_RECORD(iface, struct d3drm_frame, IDirect3DRMFrame3_iface);
75 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
77 static inline struct d3drm_frame_array *impl_from_IDirect3DRMFrameArray(IDirect3DRMFrameArray *iface)
79 return CONTAINING_RECORD(iface, struct d3drm_frame_array, IDirect3DRMFrameArray_iface);
82 static inline struct d3drm_visual_array *impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray *iface)
84 return CONTAINING_RECORD(iface, struct d3drm_visual_array, IDirect3DRMVisualArray_iface);
87 static inline struct d3drm_light_array *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface)
89 return CONTAINING_RECORD(iface, struct d3drm_light_array, IDirect3DRMLightArray_iface);
92 static HRESULT WINAPI d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray *iface, REFIID riid, void **out)
94 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
96 if (IsEqualGUID(riid, &IID_IDirect3DRMFrameArray)
97 || IsEqualGUID(riid, &IID_IUnknown))
99 IDirect3DRMFrameArray_AddRef(iface);
100 *out = iface;
101 return S_OK;
104 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
106 *out = NULL;
107 return E_NOINTERFACE;
110 static ULONG WINAPI d3drm_frame_array_AddRef(IDirect3DRMFrameArray *iface)
112 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
113 ULONG refcount = InterlockedIncrement(&array->ref);
115 TRACE("%p increasing refcount to %u.\n", iface, refcount);
117 return refcount;
120 static ULONG WINAPI d3drm_frame_array_Release(IDirect3DRMFrameArray *iface)
122 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
123 ULONG refcount = InterlockedDecrement(&array->ref);
124 ULONG i;
126 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
128 if (!refcount)
130 for (i = 0; i < array->size; ++i)
132 IDirect3DRMFrame_Release(array->frames[i]);
134 HeapFree(GetProcessHeap(), 0, array->frames);
135 HeapFree(GetProcessHeap(), 0, array);
138 return refcount;
141 static DWORD WINAPI d3drm_frame_array_GetSize(IDirect3DRMFrameArray *iface)
143 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
145 TRACE("iface %p.\n", iface);
147 return array->size;
150 static HRESULT WINAPI d3drm_frame_array_GetElement(IDirect3DRMFrameArray *iface,
151 DWORD index, IDirect3DRMFrame **frame)
153 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
155 TRACE("iface %p, index %u, frame %p.\n", iface, index, frame);
157 if (!frame)
158 return D3DRMERR_BADVALUE;
160 if (index >= array->size)
162 *frame = NULL;
163 return D3DRMERR_BADVALUE;
166 IDirect3DRMFrame_AddRef(array->frames[index]);
167 *frame = array->frames[index];
169 return D3DRM_OK;
172 static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl =
174 d3drm_frame_array_QueryInterface,
175 d3drm_frame_array_AddRef,
176 d3drm_frame_array_Release,
177 d3drm_frame_array_GetSize,
178 d3drm_frame_array_GetElement,
181 static struct d3drm_frame_array *d3drm_frame_array_create(unsigned int frame_count, IDirect3DRMFrame3 **frames)
183 struct d3drm_frame_array *array;
184 unsigned int i;
186 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
187 return NULL;
189 array->IDirect3DRMFrameArray_iface.lpVtbl = &d3drm_frame_array_vtbl;
190 array->ref = 1;
191 array->size = frame_count;
193 if (frame_count)
195 if (!(array->frames = HeapAlloc(GetProcessHeap(), 0, frame_count * sizeof(*array->frames))))
197 HeapFree(GetProcessHeap(), 0, array);
198 return NULL;
201 for (i = 0; i < frame_count; ++i)
203 IDirect3DRMFrame3_QueryInterface(frames[i], &IID_IDirect3DRMFrame, (void **)&array->frames[i]);
207 return array;
210 static HRESULT WINAPI d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out)
212 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
214 if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray)
215 || IsEqualGUID(riid, &IID_IUnknown))
217 IDirect3DRMVisualArray_AddRef(iface);
218 *out = iface;
219 return S_OK;
222 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
224 *out = NULL;
225 return E_NOINTERFACE;
228 static ULONG WINAPI d3drm_visual_array_AddRef(IDirect3DRMVisualArray *iface)
230 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
231 ULONG refcount = InterlockedIncrement(&array->ref);
233 TRACE("%p increasing refcount to %u.\n", iface, refcount);
235 return refcount;
238 static ULONG WINAPI d3drm_visual_array_Release(IDirect3DRMVisualArray *iface)
240 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
241 ULONG refcount = InterlockedDecrement(&array->ref);
242 ULONG i;
244 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
246 if (!refcount)
248 for (i = 0; i < array->size; ++i)
250 IDirect3DRMVisual_Release(array->visuals[i]);
252 HeapFree(GetProcessHeap(), 0, array->visuals);
253 HeapFree(GetProcessHeap(), 0, array);
256 return refcount;
259 static DWORD WINAPI d3drm_visual_array_GetSize(IDirect3DRMVisualArray *iface)
261 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
263 TRACE("iface %p.\n", iface);
265 return array->size;
268 static HRESULT WINAPI d3drm_visual_array_GetElement(IDirect3DRMVisualArray *iface,
269 DWORD index, IDirect3DRMVisual **visual)
271 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
273 TRACE("iface %p, index %u, visual %p.\n", iface, index, visual);
275 if (!visual)
276 return D3DRMERR_BADVALUE;
278 if (index >= array->size)
280 *visual = NULL;
281 return D3DRMERR_BADVALUE;
284 IDirect3DRMVisual_AddRef(array->visuals[index]);
285 *visual = array->visuals[index];
287 return D3DRM_OK;
290 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl =
292 d3drm_visual_array_QueryInterface,
293 d3drm_visual_array_AddRef,
294 d3drm_visual_array_Release,
295 d3drm_visual_array_GetSize,
296 d3drm_visual_array_GetElement,
299 static struct d3drm_visual_array *d3drm_visual_array_create(unsigned int visual_count, IDirect3DRMVisual **visuals)
301 struct d3drm_visual_array *array;
302 unsigned int i;
304 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
305 return NULL;
307 array->IDirect3DRMVisualArray_iface.lpVtbl = &d3drm_visual_array_vtbl;
308 array->ref = 1;
309 array->size = visual_count;
311 if (visual_count)
313 if (!(array->visuals = HeapAlloc(GetProcessHeap(), 0, visual_count * sizeof(*array->visuals))))
315 HeapFree(GetProcessHeap(), 0, array);
316 return NULL;
319 for (i = 0; i < visual_count; ++i)
321 array->visuals[i] = visuals[i];
322 IDirect3DRMVisual_AddRef(array->visuals[i]);
326 return array;
329 static HRESULT WINAPI d3drm_light_array_QueryInterface(IDirect3DRMLightArray *iface, REFIID riid, void **out)
331 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
333 if (IsEqualGUID(riid, &IID_IDirect3DRMLightArray)
334 || IsEqualGUID(riid, &IID_IUnknown))
336 IDirect3DRMLightArray_AddRef(iface);
337 *out = iface;
338 return S_OK;
341 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
343 *out = NULL;
344 return E_NOINTERFACE;
347 static ULONG WINAPI d3drm_light_array_AddRef(IDirect3DRMLightArray *iface)
349 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
350 ULONG refcount = InterlockedIncrement(&array->ref);
352 TRACE("%p increasing refcount to %u.\n", iface, refcount);
354 return refcount;
357 static ULONG WINAPI d3drm_light_array_Release(IDirect3DRMLightArray *iface)
359 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
360 ULONG refcount = InterlockedDecrement(&array->ref);
361 ULONG i;
363 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
365 if (!refcount)
367 for (i = 0; i < array->size; ++i)
369 IDirect3DRMLight_Release(array->lights[i]);
371 HeapFree(GetProcessHeap(), 0, array->lights);
372 HeapFree(GetProcessHeap(), 0, array);
375 return refcount;
378 static DWORD WINAPI d3drm_light_array_GetSize(IDirect3DRMLightArray *iface)
380 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
382 TRACE("iface %p.\n", iface);
384 return array->size;
387 static HRESULT WINAPI d3drm_light_array_GetElement(IDirect3DRMLightArray *iface,
388 DWORD index, IDirect3DRMLight **light)
390 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
392 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
394 if (!light)
395 return D3DRMERR_BADVALUE;
397 if (index >= array->size)
399 *light = NULL;
400 return D3DRMERR_BADVALUE;
403 IDirect3DRMLight_AddRef(array->lights[index]);
404 *light = array->lights[index];
406 return D3DRM_OK;
409 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
411 d3drm_light_array_QueryInterface,
412 d3drm_light_array_AddRef,
413 d3drm_light_array_Release,
414 d3drm_light_array_GetSize,
415 d3drm_light_array_GetElement,
418 static struct d3drm_light_array *d3drm_light_array_create(unsigned int light_count, IDirect3DRMLight **lights)
420 struct d3drm_light_array *array;
421 unsigned int i;
423 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
424 return NULL;
426 array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl;
427 array->ref = 1;
428 array->size = light_count;
430 if (light_count)
432 if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, light_count * sizeof(*array->lights))))
434 HeapFree(GetProcessHeap(), 0, array);
435 return NULL;
438 for (i = 0; i < light_count; ++i)
440 array->lights[i] = lights[i];
441 IDirect3DRMLight_AddRef(array->lights[i]);
445 return array;
448 static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out)
450 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
452 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
454 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame)
455 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
456 || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
457 || IsEqualGUID(riid, &IID_IUnknown))
459 *out = &frame->IDirect3DRMFrame_iface;
461 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
463 *out = &frame->IDirect3DRMFrame2_iface;
465 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
467 *out = &frame->IDirect3DRMFrame3_iface;
469 else
471 *out = NULL;
472 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
473 return CLASS_E_CLASSNOTAVAILABLE;
476 IUnknown_AddRef((IUnknown *)*out);
477 return S_OK;
480 static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out)
482 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
484 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
486 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
489 static HRESULT WINAPI d3drm_frame1_QueryInterface(IDirect3DRMFrame *iface, REFIID riid, void **out)
491 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
493 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
495 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
498 static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface)
500 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
501 ULONG refcount = InterlockedIncrement(&frame->ref);
503 TRACE("%p increasing refcount to %u.\n", iface, refcount);
505 return refcount;
508 static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface)
510 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
512 TRACE("iface %p.\n", iface);
514 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
517 static ULONG WINAPI d3drm_frame1_AddRef(IDirect3DRMFrame *iface)
519 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
521 TRACE("iface %p.\n", iface);
523 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
526 static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
528 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
529 ULONG refcount = InterlockedDecrement(&frame->ref);
530 ULONG i;
532 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
534 if (!refcount)
536 for (i = 0; i < frame->nb_children; ++i)
538 IDirect3DRMFrame3_Release(frame->children[i]);
540 HeapFree(GetProcessHeap(), 0, frame->children);
541 for (i = 0; i < frame->nb_visuals; ++i)
543 IDirect3DRMVisual_Release(frame->visuals[i]);
545 HeapFree(GetProcessHeap(), 0, frame->visuals);
546 for (i = 0; i < frame->nb_lights; ++i)
548 IDirect3DRMLight_Release(frame->lights[i]);
550 HeapFree(GetProcessHeap(), 0, frame->lights);
551 HeapFree(GetProcessHeap(), 0, frame);
554 return refcount;
557 static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface)
559 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
561 TRACE("iface %p.\n", iface);
563 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
566 static ULONG WINAPI d3drm_frame1_Release(IDirect3DRMFrame *iface)
568 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
570 TRACE("iface %p.\n", iface);
572 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
575 static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface,
576 IUnknown *outer, REFIID iid, void **out)
578 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
580 return E_NOTIMPL;
583 static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface,
584 IUnknown *outer, REFIID iid, void **out)
586 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
588 return E_NOTIMPL;
591 static HRESULT WINAPI d3drm_frame1_Clone(IDirect3DRMFrame *iface,
592 IUnknown *outer, REFIID iid, void **out)
594 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
596 return E_NOTIMPL;
599 static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface,
600 D3DRMOBJECTCALLBACK cb, void *ctx)
602 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
604 return E_NOTIMPL;
607 static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface,
608 D3DRMOBJECTCALLBACK cb, void *ctx)
610 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
612 return E_NOTIMPL;
615 static HRESULT WINAPI d3drm_frame1_AddDestroyCallback(IDirect3DRMFrame *iface,
616 D3DRMOBJECTCALLBACK cb, void *ctx)
618 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
620 return E_NOTIMPL;
623 static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
624 D3DRMOBJECTCALLBACK cb, void *ctx)
626 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
628 return E_NOTIMPL;
631 static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
632 D3DRMOBJECTCALLBACK cb, void *ctx)
634 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
636 return E_NOTIMPL;
639 static HRESULT WINAPI d3drm_frame1_DeleteDestroyCallback(IDirect3DRMFrame *iface,
640 D3DRMOBJECTCALLBACK cb, void *ctx)
642 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
644 return E_NOTIMPL;
647 static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data)
649 FIXME("iface %p, data %#x stub!\n", iface, data);
651 return E_NOTIMPL;
654 static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data)
656 FIXME("iface %p, data %#x stub!\n", iface, data);
658 return E_NOTIMPL;
661 static HRESULT WINAPI d3drm_frame1_SetAppData(IDirect3DRMFrame *iface, DWORD data)
663 FIXME("iface %p, data %#x stub!\n", iface, data);
665 return E_NOTIMPL;
668 static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface)
670 FIXME("iface %p stub!\n", iface);
672 return 0;
675 static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface)
677 FIXME("iface %p stub!\n", iface);
679 return 0;
682 static DWORD WINAPI d3drm_frame1_GetAppData(IDirect3DRMFrame *iface)
684 FIXME("iface %p stub!\n", iface);
686 return 0;
689 static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name)
691 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
693 return E_NOTIMPL;
696 static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name)
698 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
700 return E_NOTIMPL;
703 static HRESULT WINAPI d3drm_frame1_SetName(IDirect3DRMFrame *iface, const char *name)
705 FIXME("iface %p, name %s stub!\n", iface, debugstr_a(name));
707 return E_NOTIMPL;
710 static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
712 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
714 return E_NOTIMPL;
717 static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
719 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
721 return E_NOTIMPL;
724 static HRESULT WINAPI d3drm_frame1_GetName(IDirect3DRMFrame *iface, DWORD *size, char *name)
726 FIXME("iface %p, size %p, name %p stub!\n", iface, size, name);
728 return E_NOTIMPL;
731 static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
733 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
735 if (!size || *size < strlen("Frame") || !name)
736 return E_INVALIDARG;
738 strcpy(name, "Frame");
739 *size = sizeof("Frame");
741 return D3DRM_OK;
744 static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
746 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
748 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
750 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
753 static HRESULT WINAPI d3drm_frame1_GetClassName(IDirect3DRMFrame *iface, DWORD *size, char *name)
755 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
757 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
759 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
762 static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
764 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
765 struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
767 TRACE("iface %p, child %p.\n", iface, child);
769 if (!child_obj)
770 return D3DRMERR_BADOBJECT;
772 if (child_obj->parent)
774 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
776 if (parent == iface)
778 /* Passed frame is already a child so return success */
779 return D3DRM_OK;
781 else
783 /* Remove parent and continue */
784 IDirect3DRMFrame3_DeleteChild(parent, child);
788 if ((This->nb_children + 1) > This->children_capacity)
790 ULONG new_capacity;
791 IDirect3DRMFrame3** children;
793 if (!This->children_capacity)
795 new_capacity = 16;
796 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
798 else
800 new_capacity = This->children_capacity * 2;
801 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
804 if (!children)
805 return E_OUTOFMEMORY;
807 This->children_capacity = new_capacity;
808 This->children = children;
811 This->children[This->nb_children++] = child;
812 IDirect3DRMFrame3_AddRef(child);
813 child_obj->parent = This;
815 return D3DRM_OK;
818 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
820 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
821 IDirect3DRMFrame3 *child3;
822 HRESULT hr;
824 TRACE("iface %p, child %p.\n", iface, child);
826 if (!child)
827 return D3DRMERR_BADOBJECT;
828 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
829 if (hr != S_OK)
830 return D3DRMERR_BADOBJECT;
831 IDirect3DRMFrame_Release(child);
833 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
836 static HRESULT WINAPI d3drm_frame1_AddChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
838 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
839 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
841 TRACE("iface %p, child %p.\n", iface, child);
843 if (!child_frame)
844 return D3DRMERR_BADOBJECT;
846 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
849 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
851 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
852 ULONG i;
853 IDirect3DRMLight** lights;
855 TRACE("iface %p, light %p.\n", iface, light);
857 if (!light)
858 return D3DRMERR_BADOBJECT;
860 /* Check if already existing and return gracefully without increasing ref count */
861 for (i = 0; i < This->nb_lights; i++)
862 if (This->lights[i] == light)
863 return D3DRM_OK;
865 if ((This->nb_lights + 1) > This->lights_capacity)
867 ULONG new_capacity;
869 if (!This->lights_capacity)
871 new_capacity = 16;
872 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
874 else
876 new_capacity = This->lights_capacity * 2;
877 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
880 if (!lights)
881 return E_OUTOFMEMORY;
883 This->lights_capacity = new_capacity;
884 This->lights = lights;
887 This->lights[This->nb_lights++] = light;
888 IDirect3DRMLight_AddRef(light);
890 return D3DRM_OK;
893 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
895 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
897 TRACE("iface %p, light %p.\n", iface, light);
899 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
902 static HRESULT WINAPI d3drm_frame1_AddLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
904 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
906 TRACE("iface %p, light %p.\n", iface, light);
908 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
911 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
912 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
914 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
916 return E_NOTIMPL;
919 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
920 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
922 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
924 return E_NOTIMPL;
927 static HRESULT WINAPI d3drm_frame1_AddMoveCallback(IDirect3DRMFrame *iface,
928 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
930 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
932 return E_NOTIMPL;
935 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
936 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
938 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
940 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
942 switch (type)
944 case D3DRMCOMBINE_REPLACE:
945 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
946 break;
948 case D3DRMCOMBINE_BEFORE:
949 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
950 break;
952 case D3DRMCOMBINE_AFTER:
953 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
954 break;
956 default:
957 WARN("Unknown Combine Type %u\n", type);
958 return D3DRMERR_BADVALUE;
961 return S_OK;
964 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface,
965 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
967 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
969 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
971 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
974 static HRESULT WINAPI d3drm_frame1_AddTransform(IDirect3DRMFrame *iface,
975 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
977 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
979 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
981 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
984 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
985 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
987 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
989 return E_NOTIMPL;
992 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
993 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
995 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
997 return E_NOTIMPL;
1000 static HRESULT WINAPI d3drm_frame1_AddTranslation(IDirect3DRMFrame *iface,
1001 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1003 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1005 return E_NOTIMPL;
1008 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1009 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1011 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1013 return E_NOTIMPL;
1016 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
1017 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1019 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1021 return E_NOTIMPL;
1024 static HRESULT WINAPI d3drm_frame1_AddScale(IDirect3DRMFrame *iface,
1025 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1027 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1029 return E_NOTIMPL;
1032 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1033 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1035 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1036 iface, type, x, y, z, theta);
1038 return E_NOTIMPL;
1041 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
1042 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1044 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1046 return E_NOTIMPL;
1049 static HRESULT WINAPI d3drm_frame1_AddRotation(IDirect3DRMFrame *iface,
1050 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1052 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1054 return E_NOTIMPL;
1057 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1059 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1060 ULONG i;
1061 IDirect3DRMVisual** visuals;
1063 TRACE("iface %p, visual %p.\n", iface, visual);
1065 if (!visual)
1066 return D3DRMERR_BADOBJECT;
1068 /* Check if already existing and return gracefully without increasing ref count */
1069 for (i = 0; i < This->nb_visuals; i++)
1070 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1071 return D3DRM_OK;
1073 if ((This->nb_visuals + 1) > This->visuals_capacity)
1075 ULONG new_capacity;
1077 if (!This->visuals_capacity)
1079 new_capacity = 16;
1080 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1082 else
1084 new_capacity = This->visuals_capacity * 2;
1085 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1088 if (!visuals)
1089 return E_OUTOFMEMORY;
1091 This->visuals_capacity = new_capacity;
1092 This->visuals = visuals;
1095 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1096 IDirect3DRMVisual_AddRef(visual);
1098 return D3DRM_OK;
1101 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1103 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1105 TRACE("iface %p, visual %p.\n", iface, visual);
1107 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1110 static HRESULT WINAPI d3drm_frame1_AddVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1112 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1114 TRACE("iface %p, visual %p.\n", iface, visual);
1116 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1119 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1121 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1122 struct d3drm_frame_array *array;
1124 TRACE("iface %p, children %p.\n", iface, children);
1126 if (!children)
1127 return D3DRMERR_BADVALUE;
1129 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1130 return E_OUTOFMEMORY;
1132 *children = &array->IDirect3DRMFrameArray_iface;
1134 return D3DRM_OK;
1137 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
1139 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1141 TRACE("iface %p, children %p.\n", iface, children);
1143 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1146 static HRESULT WINAPI d3drm_frame1_GetChildren(IDirect3DRMFrame *iface, IDirect3DRMFrameArray **children)
1148 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1150 TRACE("iface %p, children %p.\n", iface, children);
1152 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1155 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1157 FIXME("iface %p stub!\n", iface);
1159 return 0;
1162 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
1164 FIXME("iface %p stub!\n", iface);
1166 return 0;
1169 static D3DCOLOR WINAPI d3drm_frame1_GetColor(IDirect3DRMFrame *iface)
1171 FIXME("iface %p stub!\n", iface);
1173 return 0;
1176 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1178 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1179 struct d3drm_light_array *array;
1181 TRACE("iface %p, lights %p.\n", iface, lights);
1183 if (!lights)
1184 return D3DRMERR_BADVALUE;
1186 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1187 return E_OUTOFMEMORY;
1189 *lights = &array->IDirect3DRMLightArray_iface;
1191 return D3DRM_OK;
1194 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
1196 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1198 TRACE("iface %p, lights %p.\n", iface, lights);
1200 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1203 static HRESULT WINAPI d3drm_frame1_GetLights(IDirect3DRMFrame *iface, IDirect3DRMLightArray **lights)
1205 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1207 TRACE("iface %p, lights %p.\n", iface, lights);
1209 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1212 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1214 FIXME("iface %p stub!\n", iface);
1216 return D3DRMMATERIAL_FROMPARENT;
1219 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
1221 FIXME("iface %p stub!\n", iface);
1223 return D3DRMMATERIAL_FROMPARENT;
1226 static D3DRMMATERIALMODE WINAPI d3drm_frame1_GetMaterialMode(IDirect3DRMFrame *iface)
1228 FIXME("iface %p stub!\n", iface);
1230 return D3DRMMATERIAL_FROMPARENT;
1233 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1235 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1237 TRACE("iface %p, parent %p.\n", iface, parent);
1239 if (!parent)
1240 return D3DRMERR_BADVALUE;
1242 if (frame->parent)
1244 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1245 IDirect3DRMFrame_AddRef(*parent);
1247 else
1249 *parent = NULL;
1252 return D3DRM_OK;
1255 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
1257 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1259 TRACE("iface %p, parent %p.\n", iface, parent);
1261 if (!parent)
1262 return D3DRMERR_BADVALUE;
1264 if (frame->parent)
1266 *parent = &frame->parent->IDirect3DRMFrame_iface;
1267 IDirect3DRMFrame_AddRef(*parent);
1269 else
1271 *parent = NULL;
1274 return D3DRM_OK;
1277 static HRESULT WINAPI d3drm_frame1_GetParent(IDirect3DRMFrame *iface, IDirect3DRMFrame **parent)
1279 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1281 TRACE("iface %p, parent %p.\n", iface, parent);
1283 return d3drm_frame2_GetParent(&frame->IDirect3DRMFrame2_iface, parent);
1286 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1287 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1289 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1291 return E_NOTIMPL;
1294 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
1295 IDirect3DRMFrame *reference, D3DVECTOR *position)
1297 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1299 return E_NOTIMPL;
1302 static HRESULT WINAPI d3drm_frame1_GetPosition(IDirect3DRMFrame *iface,
1303 IDirect3DRMFrame *reference, D3DVECTOR *position)
1305 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1307 return E_NOTIMPL;
1311 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1312 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1314 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1316 return E_NOTIMPL;
1319 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
1320 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1322 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1324 return E_NOTIMPL;
1327 static HRESULT WINAPI d3drm_frame1_GetRotation(IDirect3DRMFrame *iface,
1328 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1330 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1332 return E_NOTIMPL;
1335 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1337 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1339 TRACE("iface %p, scene %p.\n", iface, scene);
1341 if (!scene)
1342 return D3DRMERR_BADVALUE;
1344 while (frame->parent)
1345 frame = frame->parent;
1347 *scene = &frame->IDirect3DRMFrame3_iface;
1348 IDirect3DRMFrame3_AddRef(*scene);
1350 return D3DRM_OK;
1353 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
1355 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1356 IDirect3DRMFrame3 *frame3;
1357 HRESULT hr;
1359 TRACE("iface %p, scene %p.\n", iface, scene);
1361 if (!scene)
1362 return D3DRMERR_BADVALUE;
1364 hr = IDirect3DRMFrame3_GetScene(&frame->IDirect3DRMFrame3_iface, &frame3);
1365 if (FAILED(hr) || !frame3)
1367 *scene = NULL;
1368 return hr;
1371 hr = IDirect3DRMFrame3_QueryInterface(frame3, &IID_IDirect3DRMFrame, (void **)scene);
1372 IDirect3DRMFrame3_Release(frame3);
1374 return hr;
1377 static HRESULT WINAPI d3drm_frame1_GetScene(IDirect3DRMFrame *iface, IDirect3DRMFrame **scene)
1379 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1381 TRACE("iface %p, scene %p.\n", iface, scene);
1383 return d3drm_frame2_GetScene(&frame->IDirect3DRMFrame2_iface, scene);
1386 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1388 FIXME("iface %p stub!\n", iface);
1390 return D3DRMSORT_FROMPARENT;
1393 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
1395 FIXME("iface %p stub!\n", iface);
1397 return D3DRMSORT_FROMPARENT;
1400 static D3DRMSORTMODE WINAPI d3drm_frame1_GetSortMode(IDirect3DRMFrame *iface)
1402 FIXME("iface %p stub!\n", iface);
1404 return D3DRMSORT_FROMPARENT;
1407 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1409 FIXME("iface %p, texture %p stub!\n", iface, texture);
1411 return E_NOTIMPL;
1414 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
1416 FIXME("iface %p, texture %p stub!\n", iface, texture);
1418 return E_NOTIMPL;
1421 static HRESULT WINAPI d3drm_frame1_GetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture **texture)
1423 FIXME("iface %p, texture %p stub!\n", iface, texture);
1425 return E_NOTIMPL;
1428 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1429 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1431 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1433 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1435 if (reference)
1436 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1438 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1440 return D3DRM_OK;
1443 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
1445 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1447 TRACE("iface %p, matrix %p.\n", iface, matrix);
1449 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1451 return D3DRM_OK;
1454 static HRESULT WINAPI d3drm_frame1_GetTransform(IDirect3DRMFrame *iface, D3DRMMATRIX4D matrix)
1456 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1458 TRACE("iface %p, matrix %p.\n", iface, matrix);
1460 return d3drm_frame2_GetTransform(&frame->IDirect3DRMFrame2_iface, matrix);
1463 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1464 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1466 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1467 iface, reference, velocity, with_rotation);
1469 return E_NOTIMPL;
1472 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
1473 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1475 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1476 iface, reference, velocity, with_rotation);
1478 return E_NOTIMPL;
1481 static HRESULT WINAPI d3drm_frame1_GetVelocity(IDirect3DRMFrame *iface,
1482 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1484 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1485 iface, reference, velocity, with_rotation);
1487 return E_NOTIMPL;
1490 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1491 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1493 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1495 return E_NOTIMPL;
1498 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
1499 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1501 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1503 return E_NOTIMPL;
1506 static HRESULT WINAPI d3drm_frame1_GetOrientation(IDirect3DRMFrame *iface,
1507 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1509 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1511 return E_NOTIMPL;
1514 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface, DWORD *count, IUnknown **visuals)
1516 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1518 return E_NOTIMPL;
1521 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
1523 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1524 struct d3drm_visual_array *array;
1526 TRACE("iface %p, visuals %p.\n", iface, visuals);
1528 if (!visuals)
1529 return D3DRMERR_BADVALUE;
1531 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
1532 return E_OUTOFMEMORY;
1534 *visuals = &array->IDirect3DRMVisualArray_iface;
1536 return D3DRM_OK;
1539 static HRESULT WINAPI d3drm_frame1_GetVisuals(IDirect3DRMFrame *iface, IDirect3DRMVisualArray **visuals)
1541 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1543 TRACE("iface %p, visuals %p.\n", iface, visuals);
1545 return d3drm_frame2_GetVisuals(&frame->IDirect3DRMFrame2_iface, visuals);
1548 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
1550 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1552 return E_NOTIMPL;
1555 static HRESULT WINAPI d3drm_frame1_GetTextureTopology(IDirect3DRMFrame *iface, BOOL *wrap_u, BOOL *wrap_v)
1557 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1559 return E_NOTIMPL;
1562 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1564 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1566 return E_NOTIMPL;
1569 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1571 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1573 return E_NOTIMPL;
1576 static HRESULT WINAPI d3drm_frame1_InverseTransform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
1578 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1580 return E_NOTIMPL;
1583 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1584 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1586 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1587 iface, filename, name, flags, cb, ctx);
1589 return E_NOTIMPL;
1592 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
1593 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1595 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1596 iface, filename, name, flags, cb, ctx);
1598 return E_NOTIMPL;
1601 static HRESULT WINAPI d3drm_frame1_Load(IDirect3DRMFrame *iface, void *filename,
1602 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1604 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1605 iface, filename, name, flags, cb, ctx);
1607 return E_NOTIMPL;
1610 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1611 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1613 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1615 return E_NOTIMPL;
1618 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
1619 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1621 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1623 return E_NOTIMPL;
1626 static HRESULT WINAPI d3drm_frame1_LookAt(IDirect3DRMFrame *iface, IDirect3DRMFrame *target,
1627 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1629 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1631 return E_NOTIMPL;
1634 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1636 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1638 return E_NOTIMPL;
1641 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
1643 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1645 return E_NOTIMPL;
1648 static HRESULT WINAPI d3drm_frame1_Move(IDirect3DRMFrame *iface, D3DVALUE delta)
1650 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1652 return E_NOTIMPL;
1655 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1657 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1658 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1659 ULONG i;
1661 TRACE("iface %p, child %p.\n", iface, child);
1663 if (!child_impl)
1664 return D3DRMERR_BADOBJECT;
1666 /* Check if child exists */
1667 for (i = 0; i < frame->nb_children; ++i)
1669 if (frame->children[i] == child)
1670 break;
1673 if (i == frame->nb_children)
1674 return D3DRMERR_BADVALUE;
1676 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1677 IDirect3DRMFrame3_Release(child);
1678 child_impl->parent = NULL;
1679 --frame->nb_children;
1681 return D3DRM_OK;
1684 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
1686 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1687 IDirect3DRMFrame3 *child3;
1688 HRESULT hr;
1690 TRACE("iface %p, child %p.\n", iface, child);
1692 if (!child)
1693 return D3DRMERR_BADOBJECT;
1694 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
1695 return D3DRMERR_BADOBJECT;
1696 IDirect3DRMFrame_Release(child);
1698 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
1701 static HRESULT WINAPI d3drm_frame1_DeleteChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
1703 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1704 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
1706 TRACE("iface %p, child %p.\n", iface, child);
1708 if (!child_frame)
1709 return D3DRMERR_BADOBJECT;
1711 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
1714 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1716 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1717 ULONG i;
1719 TRACE("iface %p, light %p.\n", iface, light);
1721 if (!light)
1722 return D3DRMERR_BADOBJECT;
1724 /* Check if visual exists */
1725 for (i = 0; i < frame->nb_lights; ++i)
1727 if (frame->lights[i] == light)
1728 break;
1731 if (i == frame->nb_lights)
1732 return D3DRMERR_BADVALUE;
1734 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1735 IDirect3DRMLight_Release(light);
1736 --frame->nb_lights;
1738 return D3DRM_OK;
1741 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
1743 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1745 TRACE("iface %p, light %p.\n", iface, light);
1747 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1750 static HRESULT WINAPI d3drm_frame1_DeleteLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
1752 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1754 TRACE("iface %p, light %p.\n", iface, light);
1756 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1759 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1760 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1762 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1764 return E_NOTIMPL;
1767 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
1768 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1770 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1772 return E_NOTIMPL;
1775 static HRESULT WINAPI d3drm_frame1_DeleteMoveCallback(IDirect3DRMFrame *iface,
1776 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1778 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1780 return E_NOTIMPL;
1783 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1785 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1786 ULONG i;
1788 TRACE("iface %p, visual %p.\n", iface, visual);
1790 if (!visual)
1791 return D3DRMERR_BADOBJECT;
1793 /* Check if visual exists */
1794 for (i = 0; i < frame->nb_visuals; ++i)
1796 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1797 break;
1800 if (i == frame->nb_visuals)
1801 return D3DRMERR_BADVALUE;
1803 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1804 IDirect3DRMVisual_Release(visual);
1805 --frame->nb_visuals;
1807 return D3DRM_OK;
1810 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1812 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1814 TRACE("iface %p, visual %p.\n", iface, visual);
1816 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1819 static HRESULT WINAPI d3drm_frame1_DeleteVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1821 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1823 TRACE("iface %p, visual %p.\n", iface, visual);
1825 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1828 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1830 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1832 TRACE("iface %p.\n", iface);
1834 return frame->scenebackground;
1837 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
1839 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1841 TRACE("iface %p.\n", iface);
1843 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1846 static D3DCOLOR WINAPI d3drm_frame1_GetSceneBackground(IDirect3DRMFrame *iface)
1848 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1850 TRACE("iface %p.\n", iface);
1852 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1855 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1856 IDirectDrawSurface **surface)
1858 FIXME("iface %p, surface %p stub!\n", iface, surface);
1860 return E_NOTIMPL;
1863 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
1864 IDirectDrawSurface **surface)
1866 FIXME("iface %p, surface %p stub!\n", iface, surface);
1868 return E_NOTIMPL;
1871 static HRESULT WINAPI d3drm_frame1_GetSceneBackgroundDepth(IDirect3DRMFrame *iface,
1872 IDirectDrawSurface **surface)
1874 FIXME("iface %p, surface %p stub!\n", iface, surface);
1876 return E_NOTIMPL;
1879 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1881 FIXME("iface %p stub!\n", iface);
1883 return 0;
1886 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
1888 FIXME("iface %p stub!\n", iface);
1890 return 0;
1893 static D3DCOLOR WINAPI d3drm_frame1_GetSceneFogColor(IDirect3DRMFrame *iface)
1895 FIXME("iface %p stub!\n", iface);
1897 return 0;
1900 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1902 FIXME("iface %p stub!\n", iface);
1904 return FALSE;
1907 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
1909 FIXME("iface %p stub!\n", iface);
1911 return FALSE;
1914 static BOOL WINAPI d3drm_frame1_GetSceneFogEnable(IDirect3DRMFrame *iface)
1916 FIXME("iface %p stub!\n", iface);
1918 return FALSE;
1921 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1923 FIXME("iface %p stub!\n", iface);
1925 return D3DRMFOG_LINEAR;
1928 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
1930 FIXME("iface %p stub!\n", iface);
1932 return D3DRMFOG_LINEAR;
1935 static D3DRMFOGMODE WINAPI d3drm_frame1_GetSceneFogMode(IDirect3DRMFrame *iface)
1937 FIXME("iface %p stub!\n", iface);
1939 return D3DRMFOG_LINEAR;
1942 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1943 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1945 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1947 return E_NOTIMPL;
1950 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
1951 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1953 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1955 return E_NOTIMPL;
1958 static HRESULT WINAPI d3drm_frame1_GetSceneFogParams(IDirect3DRMFrame *iface,
1959 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1961 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1963 return E_NOTIMPL;
1966 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1968 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1970 TRACE("iface %p, color 0x%08x.\n", iface, color);
1972 frame->scenebackground = color;
1974 return D3DRM_OK;
1977 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
1979 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1981 TRACE("iface %p, color 0x%08x.\n", iface, color);
1983 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1986 static HRESULT WINAPI d3drm_frame1_SetSceneBackground(IDirect3DRMFrame *iface, D3DCOLOR color)
1988 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1990 TRACE("iface %p, color 0x%08x.\n", iface, color);
1992 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1995 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
1996 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1998 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
2000 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2002 d3drm_set_color(&frame->scenebackground, red, green, blue, 1.0f);
2004 return D3DRM_OK;
2007 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
2008 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2010 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
2012 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2014 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2017 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundRGB(IDirect3DRMFrame *iface,
2018 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2020 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
2022 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2024 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2027 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
2028 IDirectDrawSurface *surface)
2030 FIXME("iface %p, surface %p stub!\n", iface, surface);
2032 return E_NOTIMPL;
2035 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
2036 IDirectDrawSurface *surface)
2038 FIXME("iface %p, surface %p stub!\n", iface, surface);
2040 return E_NOTIMPL;
2043 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *iface,
2044 IDirectDrawSurface *surface)
2046 FIXME("iface %p, surface %p stub!\n", iface, surface);
2048 return E_NOTIMPL;
2051 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
2052 IDirect3DRMTexture3 *texture)
2054 FIXME("iface %p, texture %p stub!\n", iface, texture);
2056 return E_NOTIMPL;
2059 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
2060 IDirect3DRMTexture *texture)
2062 FIXME("iface %p, texture %p stub!\n", iface, texture);
2064 return E_NOTIMPL;
2067 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface,
2068 IDirect3DRMTexture *texture)
2070 FIXME("iface %p, texture %p stub!\n", iface, texture);
2072 return E_NOTIMPL;
2075 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2077 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2079 return E_NOTIMPL;
2082 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
2084 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2086 return E_NOTIMPL;
2089 static HRESULT WINAPI d3drm_frame1_SetSceneFogEnable(IDirect3DRMFrame *iface, BOOL enable)
2091 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2093 return E_NOTIMPL;
2096 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2098 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2100 return E_NOTIMPL;
2103 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2105 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2107 return E_NOTIMPL;
2110 static HRESULT WINAPI d3drm_frame1_SetSceneFogColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2112 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2114 return E_NOTIMPL;
2117 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
2119 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2121 return E_NOTIMPL;
2124 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
2126 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2128 return E_NOTIMPL;
2131 static HRESULT WINAPI d3drm_frame1_SetSceneFogMode(IDirect3DRMFrame *iface, D3DRMFOGMODE mode)
2133 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2135 return E_NOTIMPL;
2138 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
2139 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2141 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2143 return E_NOTIMPL;
2146 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
2147 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2149 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2151 return E_NOTIMPL;
2154 static HRESULT WINAPI d3drm_frame1_SetSceneFogParams(IDirect3DRMFrame *iface,
2155 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2157 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2159 return E_NOTIMPL;
2162 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2164 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2166 return E_NOTIMPL;
2169 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2171 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2173 return E_NOTIMPL;
2176 static HRESULT WINAPI d3drm_frame1_SetColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2178 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2180 return E_NOTIMPL;
2183 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
2184 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2186 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2188 return E_NOTIMPL;
2191 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
2192 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2194 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2196 return E_NOTIMPL;
2199 static HRESULT WINAPI d3drm_frame1_SetColorRGB(IDirect3DRMFrame *iface,
2200 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2202 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2204 return E_NOTIMPL;
2207 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
2209 FIXME("iface %p stub!\n", iface);
2211 return D3DRMZBUFFER_FROMPARENT;
2214 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
2216 FIXME("iface %p stub!\n", iface);
2218 return D3DRMZBUFFER_FROMPARENT;
2221 static D3DRMZBUFFERMODE WINAPI d3drm_frame1_GetZbufferMode(IDirect3DRMFrame *iface)
2223 FIXME("iface %p stub!\n", iface);
2225 return D3DRMZBUFFER_FROMPARENT;
2228 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
2230 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2232 return E_NOTIMPL;
2235 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
2237 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2239 return E_NOTIMPL;
2242 static HRESULT WINAPI d3drm_frame1_SetMaterialMode(IDirect3DRMFrame *iface, D3DRMMATERIALMODE mode)
2244 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2246 return E_NOTIMPL;
2249 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2250 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2252 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2253 iface, reference, dx, dy, dz, ux, uy, uz);
2255 return E_NOTIMPL;
2258 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
2259 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2261 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2262 iface, reference, dx, dy, dz, ux, uy, uz);
2264 return E_NOTIMPL;
2267 static HRESULT WINAPI d3drm_frame1_SetOrientation(IDirect3DRMFrame *iface, IDirect3DRMFrame *reference,
2268 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2270 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2271 iface, reference, dx, dy, dz, ux, uy, uz);
2273 return E_NOTIMPL;
2276 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
2277 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2279 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2281 return E_NOTIMPL;
2284 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
2285 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2287 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2289 return E_NOTIMPL;
2292 static HRESULT WINAPI d3drm_frame1_SetPosition(IDirect3DRMFrame *iface,
2293 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2295 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2297 return E_NOTIMPL;
2300 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
2301 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2303 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2304 iface, reference, x, y, z, theta);
2306 return E_NOTIMPL;
2309 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
2310 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2312 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2313 iface, reference, x, y, z, theta);
2315 return E_NOTIMPL;
2318 static HRESULT WINAPI d3drm_frame1_SetRotation(IDirect3DRMFrame *iface,
2319 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2321 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2322 iface, reference, x, y, z, theta);
2324 return E_NOTIMPL;
2327 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
2329 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2331 return E_NOTIMPL;
2334 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
2336 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2338 return E_NOTIMPL;
2341 static HRESULT WINAPI d3drm_frame1_SetSortMode(IDirect3DRMFrame *iface, D3DRMSORTMODE mode)
2343 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2345 return E_NOTIMPL;
2348 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
2350 FIXME("iface %p, texture %p stub!\n", iface, texture);
2352 return E_NOTIMPL;
2355 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
2357 FIXME("iface %p, texture %p stub!\n", iface, texture);
2359 return E_NOTIMPL;
2362 static HRESULT WINAPI d3drm_frame1_SetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
2364 FIXME("iface %p, texture %p stub!\n", iface, texture);
2366 return E_NOTIMPL;
2369 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
2371 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2373 return E_NOTIMPL;
2376 static HRESULT WINAPI d3drm_frame1_SetTextureTopology(IDirect3DRMFrame *iface, BOOL wrap_u, BOOL wrap_v)
2378 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2380 return E_NOTIMPL;
2383 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
2384 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2386 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
2387 iface, reference, x, y, z, with_rotation);
2389 return E_NOTIMPL;
2392 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
2393 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2395 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2396 iface, reference, x, y, z, with_rotation);
2398 return E_NOTIMPL;
2401 static HRESULT WINAPI d3drm_frame1_SetVelocity(IDirect3DRMFrame *iface,
2402 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2404 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2405 iface, reference, x, y, z, with_rotation);
2407 return E_NOTIMPL;
2410 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
2412 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2414 return E_NOTIMPL;
2417 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
2419 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2421 return E_NOTIMPL;
2424 static HRESULT WINAPI d3drm_frame1_SetZbufferMode(IDirect3DRMFrame *iface, D3DRMZBUFFERMODE mode)
2426 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2428 return E_NOTIMPL;
2431 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
2433 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2435 return E_NOTIMPL;
2438 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
2440 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2442 return E_NOTIMPL;
2445 static HRESULT WINAPI d3drm_frame1_Transform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
2447 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2449 return E_NOTIMPL;
2452 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
2453 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
2455 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
2457 return E_NOTIMPL;
2460 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2462 FIXME("iface %p, box %p stub!\n", iface, box);
2464 return E_NOTIMPL;
2467 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2469 FIXME("iface %p, box %p stub!\n", iface, box);
2471 return E_NOTIMPL;
2474 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2476 FIXME("iface %p stub!\n", iface);
2478 return FALSE;
2481 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
2483 FIXME("iface %p stub!\n", iface);
2485 return FALSE;
2488 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2490 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2492 return E_NOTIMPL;
2495 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2497 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2499 return E_NOTIMPL;
2502 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2504 FIXME("iface %p, material %p stub!\n", iface, material);
2506 return E_NOTIMPL;
2509 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
2511 FIXME("iface %p, material %p stub!\n", iface, material);
2513 return E_NOTIMPL;
2516 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2518 FIXME("iface %p stub!\n", iface);
2520 return FALSE;
2523 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
2525 FIXME("iface %p stub!\n", iface);
2527 return FALSE;
2530 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2532 FIXME("iface %p, box %p stub!\n", iface, box);
2534 return E_NOTIMPL;
2537 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2539 FIXME("iface %p, box %p stub!\n", iface, box);
2541 return E_NOTIMPL;
2544 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2546 FIXME("iface %p, box %p stub!\n", iface, box);
2548 return E_NOTIMPL;
2551 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2553 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2555 return E_NOTIMPL;
2558 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2559 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2561 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2562 iface, dx, dy, dz, ux, uy, uz);
2564 return E_NOTIMPL;
2567 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2569 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2571 return E_NOTIMPL;
2574 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2576 FIXME("iface %p, material %p stub!\n", iface, material);
2578 return E_NOTIMPL;
2581 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2582 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2584 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2586 return E_NOTIMPL;
2589 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2590 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2592 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2593 iface, reference, ray, flags, visuals);
2595 return E_NOTIMPL;
2598 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2599 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2601 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2602 iface, debugstr_a(filename), format, flags);
2604 return E_NOTIMPL;
2607 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2608 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2610 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2612 return E_NOTIMPL;
2615 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2616 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2618 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2620 return E_NOTIMPL;
2623 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags)
2625 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2627 return E_NOTIMPL;
2630 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2632 FIXME("iface %p, flags %p stub!\n", iface, flags);
2634 return E_NOTIMPL;
2637 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2639 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2641 return E_NOTIMPL;
2644 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2646 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2648 return E_NOTIMPL;
2651 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2652 D3DRMMATERIALOVERRIDE *override)
2654 FIXME("iface %p, override %p stub!\n", iface, override);
2656 return E_NOTIMPL;
2659 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2660 D3DRMMATERIALOVERRIDE *override)
2662 FIXME("iface %p, override %p stub!\n", iface, override);
2664 return E_NOTIMPL;
2667 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2669 d3drm_frame3_QueryInterface,
2670 d3drm_frame3_AddRef,
2671 d3drm_frame3_Release,
2672 d3drm_frame3_Clone,
2673 d3drm_frame3_AddDestroyCallback,
2674 d3drm_frame3_DeleteDestroyCallback,
2675 d3drm_frame3_SetAppData,
2676 d3drm_frame3_GetAppData,
2677 d3drm_frame3_SetName,
2678 d3drm_frame3_GetName,
2679 d3drm_frame3_GetClassName,
2680 d3drm_frame3_AddChild,
2681 d3drm_frame3_AddLight,
2682 d3drm_frame3_AddMoveCallback,
2683 d3drm_frame3_AddTransform,
2684 d3drm_frame3_AddTranslation,
2685 d3drm_frame3_AddScale,
2686 d3drm_frame3_AddRotation,
2687 d3drm_frame3_AddVisual,
2688 d3drm_frame3_GetChildren,
2689 d3drm_frame3_GetColor,
2690 d3drm_frame3_GetLights,
2691 d3drm_frame3_GetMaterialMode,
2692 d3drm_frame3_GetParent,
2693 d3drm_frame3_GetPosition,
2694 d3drm_frame3_GetRotation,
2695 d3drm_frame3_GetScene,
2696 d3drm_frame3_GetSortMode,
2697 d3drm_frame3_GetTexture,
2698 d3drm_frame3_GetTransform,
2699 d3drm_frame3_GetVelocity,
2700 d3drm_frame3_GetOrientation,
2701 d3drm_frame3_GetVisuals,
2702 d3drm_frame3_InverseTransform,
2703 d3drm_frame3_Load,
2704 d3drm_frame3_LookAt,
2705 d3drm_frame3_Move,
2706 d3drm_frame3_DeleteChild,
2707 d3drm_frame3_DeleteLight,
2708 d3drm_frame3_DeleteMoveCallback,
2709 d3drm_frame3_DeleteVisual,
2710 d3drm_frame3_GetSceneBackground,
2711 d3drm_frame3_GetSceneBackgroundDepth,
2712 d3drm_frame3_GetSceneFogColor,
2713 d3drm_frame3_GetSceneFogEnable,
2714 d3drm_frame3_GetSceneFogMode,
2715 d3drm_frame3_GetSceneFogParams,
2716 d3drm_frame3_SetSceneBackground,
2717 d3drm_frame3_SetSceneBackgroundRGB,
2718 d3drm_frame3_SetSceneBackgroundDepth,
2719 d3drm_frame3_SetSceneBackgroundImage,
2720 d3drm_frame3_SetSceneFogEnable,
2721 d3drm_frame3_SetSceneFogColor,
2722 d3drm_frame3_SetSceneFogMode,
2723 d3drm_frame3_SetSceneFogParams,
2724 d3drm_frame3_SetColor,
2725 d3drm_frame3_SetColorRGB,
2726 d3drm_frame3_GetZbufferMode,
2727 d3drm_frame3_SetMaterialMode,
2728 d3drm_frame3_SetOrientation,
2729 d3drm_frame3_SetPosition,
2730 d3drm_frame3_SetRotation,
2731 d3drm_frame3_SetSortMode,
2732 d3drm_frame3_SetTexture,
2733 d3drm_frame3_SetVelocity,
2734 d3drm_frame3_SetZbufferMode,
2735 d3drm_frame3_Transform,
2736 d3drm_frame3_GetBox,
2737 d3drm_frame3_GetBoxEnable,
2738 d3drm_frame3_GetAxes,
2739 d3drm_frame3_GetMaterial,
2740 d3drm_frame3_GetInheritAxes,
2741 d3drm_frame3_GetHierarchyBox,
2742 d3drm_frame3_SetBox,
2743 d3drm_frame3_SetBoxEnable,
2744 d3drm_frame3_SetAxes,
2745 d3drm_frame3_SetInheritAxes,
2746 d3drm_frame3_SetMaterial,
2747 d3drm_frame3_SetQuaternion,
2748 d3drm_frame3_RayPick,
2749 d3drm_frame3_Save,
2750 d3drm_frame3_TransformVectors,
2751 d3drm_frame3_InverseTransformVectors,
2752 d3drm_frame3_SetTraversalOptions,
2753 d3drm_frame3_GetTraversalOptions,
2754 d3drm_frame3_SetSceneFogMethod,
2755 d3drm_frame3_GetSceneFogMethod,
2756 d3drm_frame3_SetMaterialOverride,
2757 d3drm_frame3_GetMaterialOverride,
2760 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
2762 d3drm_frame2_QueryInterface,
2763 d3drm_frame2_AddRef,
2764 d3drm_frame2_Release,
2765 d3drm_frame2_Clone,
2766 d3drm_frame2_AddDestroyCallback,
2767 d3drm_frame2_DeleteDestroyCallback,
2768 d3drm_frame2_SetAppData,
2769 d3drm_frame2_GetAppData,
2770 d3drm_frame2_SetName,
2771 d3drm_frame2_GetName,
2772 d3drm_frame2_GetClassName,
2773 d3drm_frame2_AddChild,
2774 d3drm_frame2_AddLight,
2775 d3drm_frame2_AddMoveCallback,
2776 d3drm_frame2_AddTransform,
2777 d3drm_frame2_AddTranslation,
2778 d3drm_frame2_AddScale,
2779 d3drm_frame2_AddRotation,
2780 d3drm_frame2_AddVisual,
2781 d3drm_frame2_GetChildren,
2782 d3drm_frame2_GetColor,
2783 d3drm_frame2_GetLights,
2784 d3drm_frame2_GetMaterialMode,
2785 d3drm_frame2_GetParent,
2786 d3drm_frame2_GetPosition,
2787 d3drm_frame2_GetRotation,
2788 d3drm_frame2_GetScene,
2789 d3drm_frame2_GetSortMode,
2790 d3drm_frame2_GetTexture,
2791 d3drm_frame2_GetTransform,
2792 d3drm_frame2_GetVelocity,
2793 d3drm_frame2_GetOrientation,
2794 d3drm_frame2_GetVisuals,
2795 d3drm_frame2_GetTextureTopology,
2796 d3drm_frame2_InverseTransform,
2797 d3drm_frame2_Load,
2798 d3drm_frame2_LookAt,
2799 d3drm_frame2_Move,
2800 d3drm_frame2_DeleteChild,
2801 d3drm_frame2_DeleteLight,
2802 d3drm_frame2_DeleteMoveCallback,
2803 d3drm_frame2_DeleteVisual,
2804 d3drm_frame2_GetSceneBackground,
2805 d3drm_frame2_GetSceneBackgroundDepth,
2806 d3drm_frame2_GetSceneFogColor,
2807 d3drm_frame2_GetSceneFogEnable,
2808 d3drm_frame2_GetSceneFogMode,
2809 d3drm_frame2_GetSceneFogParams,
2810 d3drm_frame2_SetSceneBackground,
2811 d3drm_frame2_SetSceneBackgroundRGB,
2812 d3drm_frame2_SetSceneBackgroundDepth,
2813 d3drm_frame2_SetSceneBackgroundImage,
2814 d3drm_frame2_SetSceneFogEnable,
2815 d3drm_frame2_SetSceneFogColor,
2816 d3drm_frame2_SetSceneFogMode,
2817 d3drm_frame2_SetSceneFogParams,
2818 d3drm_frame2_SetColor,
2819 d3drm_frame2_SetColorRGB,
2820 d3drm_frame2_GetZbufferMode,
2821 d3drm_frame2_SetMaterialMode,
2822 d3drm_frame2_SetOrientation,
2823 d3drm_frame2_SetPosition,
2824 d3drm_frame2_SetRotation,
2825 d3drm_frame2_SetSortMode,
2826 d3drm_frame2_SetTexture,
2827 d3drm_frame2_SetTextureTopology,
2828 d3drm_frame2_SetVelocity,
2829 d3drm_frame2_SetZbufferMode,
2830 d3drm_frame2_Transform,
2831 d3drm_frame2_AddMoveCallback2,
2832 d3drm_frame2_GetBox,
2833 d3drm_frame2_GetBoxEnable,
2834 d3drm_frame2_GetAxes,
2835 d3drm_frame2_GetMaterial,
2836 d3drm_frame2_GetInheritAxes,
2837 d3drm_frame2_GetHierarchyBox,
2840 static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl =
2842 d3drm_frame1_QueryInterface,
2843 d3drm_frame1_AddRef,
2844 d3drm_frame1_Release,
2845 d3drm_frame1_Clone,
2846 d3drm_frame1_AddDestroyCallback,
2847 d3drm_frame1_DeleteDestroyCallback,
2848 d3drm_frame1_SetAppData,
2849 d3drm_frame1_GetAppData,
2850 d3drm_frame1_SetName,
2851 d3drm_frame1_GetName,
2852 d3drm_frame1_GetClassName,
2853 d3drm_frame1_AddChild,
2854 d3drm_frame1_AddLight,
2855 d3drm_frame1_AddMoveCallback,
2856 d3drm_frame1_AddTransform,
2857 d3drm_frame1_AddTranslation,
2858 d3drm_frame1_AddScale,
2859 d3drm_frame1_AddRotation,
2860 d3drm_frame1_AddVisual,
2861 d3drm_frame1_GetChildren,
2862 d3drm_frame1_GetColor,
2863 d3drm_frame1_GetLights,
2864 d3drm_frame1_GetMaterialMode,
2865 d3drm_frame1_GetParent,
2866 d3drm_frame1_GetPosition,
2867 d3drm_frame1_GetRotation,
2868 d3drm_frame1_GetScene,
2869 d3drm_frame1_GetSortMode,
2870 d3drm_frame1_GetTexture,
2871 d3drm_frame1_GetTransform,
2872 d3drm_frame1_GetVelocity,
2873 d3drm_frame1_GetOrientation,
2874 d3drm_frame1_GetVisuals,
2875 d3drm_frame1_GetTextureTopology,
2876 d3drm_frame1_InverseTransform,
2877 d3drm_frame1_Load,
2878 d3drm_frame1_LookAt,
2879 d3drm_frame1_Move,
2880 d3drm_frame1_DeleteChild,
2881 d3drm_frame1_DeleteLight,
2882 d3drm_frame1_DeleteMoveCallback,
2883 d3drm_frame1_DeleteVisual,
2884 d3drm_frame1_GetSceneBackground,
2885 d3drm_frame1_GetSceneBackgroundDepth,
2886 d3drm_frame1_GetSceneFogColor,
2887 d3drm_frame1_GetSceneFogEnable,
2888 d3drm_frame1_GetSceneFogMode,
2889 d3drm_frame1_GetSceneFogParams,
2890 d3drm_frame1_SetSceneBackground,
2891 d3drm_frame1_SetSceneBackgroundRGB,
2892 d3drm_frame1_SetSceneBackgroundDepth,
2893 d3drm_frame1_SetSceneBackgroundImage,
2894 d3drm_frame1_SetSceneFogEnable,
2895 d3drm_frame1_SetSceneFogColor,
2896 d3drm_frame1_SetSceneFogMode,
2897 d3drm_frame1_SetSceneFogParams,
2898 d3drm_frame1_SetColor,
2899 d3drm_frame1_SetColorRGB,
2900 d3drm_frame1_GetZbufferMode,
2901 d3drm_frame1_SetMaterialMode,
2902 d3drm_frame1_SetOrientation,
2903 d3drm_frame1_SetPosition,
2904 d3drm_frame1_SetRotation,
2905 d3drm_frame1_SetSortMode,
2906 d3drm_frame1_SetTexture,
2907 d3drm_frame1_SetTextureTopology,
2908 d3drm_frame1_SetVelocity,
2909 d3drm_frame1_SetZbufferMode,
2910 d3drm_frame1_Transform,
2913 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2915 if (!iface)
2916 return NULL;
2917 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2919 return impl_from_IDirect3DRMFrame3(iface);
2922 struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
2924 if (!iface)
2925 return NULL;
2926 assert(iface->lpVtbl == &d3drm_frame1_vtbl);
2928 return impl_from_IDirect3DRMFrame(iface);
2931 HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm)
2933 struct d3drm_frame *object;
2934 HRESULT hr = D3DRM_OK;
2936 TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
2938 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
2939 return E_OUTOFMEMORY;
2941 object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
2942 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2943 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2944 object->d3drm = d3drm;
2945 object->ref = 1;
2946 d3drm_set_color(&object->scenebackground, 0.0f, 0.0f, 0.0f, 1.0f);
2948 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2950 if (parent_frame)
2952 IDirect3DRMFrame3 *p;
2954 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
2956 HeapFree(GetProcessHeap(), 0, object);
2957 return hr;
2959 IDirect3DRMFrame_Release(parent_frame);
2960 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2963 *frame = object;
2965 return hr;