d3drm: Use AddKey() method internally to add all types of keys.
[wine.git] / dlls / d3drm / frame.c
bloba2643fb5ac585cc17b419dd9c680fe49e8d7a251
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 inline struct d3drm_animation *impl_from_IDirect3DRMAnimation(IDirect3DRMAnimation *iface)
94 return CONTAINING_RECORD(iface, struct d3drm_animation, IDirect3DRMAnimation_iface);
97 static inline struct d3drm_animation *impl_from_IDirect3DRMAnimation2(IDirect3DRMAnimation2 *iface)
99 return CONTAINING_RECORD(iface, struct d3drm_animation, IDirect3DRMAnimation2_iface);
102 static HRESULT WINAPI d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray *iface, REFIID riid, void **out)
104 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
106 if (IsEqualGUID(riid, &IID_IDirect3DRMFrameArray)
107 || IsEqualGUID(riid, &IID_IUnknown))
109 IDirect3DRMFrameArray_AddRef(iface);
110 *out = iface;
111 return S_OK;
114 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
116 *out = NULL;
117 return E_NOINTERFACE;
120 static ULONG WINAPI d3drm_frame_array_AddRef(IDirect3DRMFrameArray *iface)
122 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
123 ULONG refcount = InterlockedIncrement(&array->ref);
125 TRACE("%p increasing refcount to %u.\n", iface, refcount);
127 return refcount;
130 static ULONG WINAPI d3drm_frame_array_Release(IDirect3DRMFrameArray *iface)
132 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
133 ULONG refcount = InterlockedDecrement(&array->ref);
134 ULONG i;
136 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
138 if (!refcount)
140 for (i = 0; i < array->size; ++i)
142 IDirect3DRMFrame_Release(array->frames[i]);
144 HeapFree(GetProcessHeap(), 0, array->frames);
145 HeapFree(GetProcessHeap(), 0, array);
148 return refcount;
151 static DWORD WINAPI d3drm_frame_array_GetSize(IDirect3DRMFrameArray *iface)
153 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
155 TRACE("iface %p.\n", iface);
157 return array->size;
160 static HRESULT WINAPI d3drm_frame_array_GetElement(IDirect3DRMFrameArray *iface,
161 DWORD index, IDirect3DRMFrame **frame)
163 struct d3drm_frame_array *array = impl_from_IDirect3DRMFrameArray(iface);
165 TRACE("iface %p, index %u, frame %p.\n", iface, index, frame);
167 if (!frame)
168 return D3DRMERR_BADVALUE;
170 if (index >= array->size)
172 *frame = NULL;
173 return D3DRMERR_BADVALUE;
176 IDirect3DRMFrame_AddRef(array->frames[index]);
177 *frame = array->frames[index];
179 return D3DRM_OK;
182 static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl =
184 d3drm_frame_array_QueryInterface,
185 d3drm_frame_array_AddRef,
186 d3drm_frame_array_Release,
187 d3drm_frame_array_GetSize,
188 d3drm_frame_array_GetElement,
191 static struct d3drm_frame_array *d3drm_frame_array_create(unsigned int frame_count, IDirect3DRMFrame3 **frames)
193 struct d3drm_frame_array *array;
194 unsigned int i;
196 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
197 return NULL;
199 array->IDirect3DRMFrameArray_iface.lpVtbl = &d3drm_frame_array_vtbl;
200 array->ref = 1;
201 array->size = frame_count;
203 if (frame_count)
205 if (!(array->frames = HeapAlloc(GetProcessHeap(), 0, frame_count * sizeof(*array->frames))))
207 HeapFree(GetProcessHeap(), 0, array);
208 return NULL;
211 for (i = 0; i < frame_count; ++i)
213 IDirect3DRMFrame3_QueryInterface(frames[i], &IID_IDirect3DRMFrame, (void **)&array->frames[i]);
217 return array;
220 static HRESULT WINAPI d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray *iface, REFIID riid, void **out)
222 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
224 if (IsEqualGUID(riid, &IID_IDirect3DRMVisualArray)
225 || IsEqualGUID(riid, &IID_IUnknown))
227 IDirect3DRMVisualArray_AddRef(iface);
228 *out = iface;
229 return S_OK;
232 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
234 *out = NULL;
235 return E_NOINTERFACE;
238 static ULONG WINAPI d3drm_visual_array_AddRef(IDirect3DRMVisualArray *iface)
240 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
241 ULONG refcount = InterlockedIncrement(&array->ref);
243 TRACE("%p increasing refcount to %u.\n", iface, refcount);
245 return refcount;
248 static ULONG WINAPI d3drm_visual_array_Release(IDirect3DRMVisualArray *iface)
250 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
251 ULONG refcount = InterlockedDecrement(&array->ref);
252 ULONG i;
254 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
256 if (!refcount)
258 for (i = 0; i < array->size; ++i)
260 IDirect3DRMVisual_Release(array->visuals[i]);
262 HeapFree(GetProcessHeap(), 0, array->visuals);
263 HeapFree(GetProcessHeap(), 0, array);
266 return refcount;
269 static DWORD WINAPI d3drm_visual_array_GetSize(IDirect3DRMVisualArray *iface)
271 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
273 TRACE("iface %p.\n", iface);
275 return array->size;
278 static HRESULT WINAPI d3drm_visual_array_GetElement(IDirect3DRMVisualArray *iface,
279 DWORD index, IDirect3DRMVisual **visual)
281 struct d3drm_visual_array *array = impl_from_IDirect3DRMVisualArray(iface);
283 TRACE("iface %p, index %u, visual %p.\n", iface, index, visual);
285 if (!visual)
286 return D3DRMERR_BADVALUE;
288 if (index >= array->size)
290 *visual = NULL;
291 return D3DRMERR_BADVALUE;
294 IDirect3DRMVisual_AddRef(array->visuals[index]);
295 *visual = array->visuals[index];
297 return D3DRM_OK;
300 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl =
302 d3drm_visual_array_QueryInterface,
303 d3drm_visual_array_AddRef,
304 d3drm_visual_array_Release,
305 d3drm_visual_array_GetSize,
306 d3drm_visual_array_GetElement,
309 static struct d3drm_visual_array *d3drm_visual_array_create(unsigned int visual_count, IDirect3DRMVisual **visuals)
311 struct d3drm_visual_array *array;
312 unsigned int i;
314 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
315 return NULL;
317 array->IDirect3DRMVisualArray_iface.lpVtbl = &d3drm_visual_array_vtbl;
318 array->ref = 1;
319 array->size = visual_count;
321 if (visual_count)
323 if (!(array->visuals = HeapAlloc(GetProcessHeap(), 0, visual_count * sizeof(*array->visuals))))
325 HeapFree(GetProcessHeap(), 0, array);
326 return NULL;
329 for (i = 0; i < visual_count; ++i)
331 array->visuals[i] = visuals[i];
332 IDirect3DRMVisual_AddRef(array->visuals[i]);
336 return array;
339 static HRESULT WINAPI d3drm_light_array_QueryInterface(IDirect3DRMLightArray *iface, REFIID riid, void **out)
341 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
343 if (IsEqualGUID(riid, &IID_IDirect3DRMLightArray)
344 || IsEqualGUID(riid, &IID_IUnknown))
346 IDirect3DRMLightArray_AddRef(iface);
347 *out = iface;
348 return S_OK;
351 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
353 *out = NULL;
354 return E_NOINTERFACE;
357 static ULONG WINAPI d3drm_light_array_AddRef(IDirect3DRMLightArray *iface)
359 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
360 ULONG refcount = InterlockedIncrement(&array->ref);
362 TRACE("%p increasing refcount to %u.\n", iface, refcount);
364 return refcount;
367 static ULONG WINAPI d3drm_light_array_Release(IDirect3DRMLightArray *iface)
369 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
370 ULONG refcount = InterlockedDecrement(&array->ref);
371 ULONG i;
373 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
375 if (!refcount)
377 for (i = 0; i < array->size; ++i)
379 IDirect3DRMLight_Release(array->lights[i]);
381 HeapFree(GetProcessHeap(), 0, array->lights);
382 HeapFree(GetProcessHeap(), 0, array);
385 return refcount;
388 static DWORD WINAPI d3drm_light_array_GetSize(IDirect3DRMLightArray *iface)
390 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
392 TRACE("iface %p.\n", iface);
394 return array->size;
397 static HRESULT WINAPI d3drm_light_array_GetElement(IDirect3DRMLightArray *iface,
398 DWORD index, IDirect3DRMLight **light)
400 struct d3drm_light_array *array = impl_from_IDirect3DRMLightArray(iface);
402 TRACE("iface %p, index %u, light %p.\n", iface, index, light);
404 if (!light)
405 return D3DRMERR_BADVALUE;
407 if (index >= array->size)
409 *light = NULL;
410 return D3DRMERR_BADVALUE;
413 IDirect3DRMLight_AddRef(array->lights[index]);
414 *light = array->lights[index];
416 return D3DRM_OK;
419 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl =
421 d3drm_light_array_QueryInterface,
422 d3drm_light_array_AddRef,
423 d3drm_light_array_Release,
424 d3drm_light_array_GetSize,
425 d3drm_light_array_GetElement,
428 static struct d3drm_light_array *d3drm_light_array_create(unsigned int light_count, IDirect3DRMLight **lights)
430 struct d3drm_light_array *array;
431 unsigned int i;
433 if (!(array = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*array))))
434 return NULL;
436 array->IDirect3DRMLightArray_iface.lpVtbl = &d3drm_light_array_vtbl;
437 array->ref = 1;
438 array->size = light_count;
440 if (light_count)
442 if (!(array->lights = HeapAlloc(GetProcessHeap(), 0, light_count * sizeof(*array->lights))))
444 HeapFree(GetProcessHeap(), 0, array);
445 return NULL;
448 for (i = 0; i < light_count; ++i)
450 array->lights[i] = lights[i];
451 IDirect3DRMLight_AddRef(array->lights[i]);
455 return array;
458 static HRESULT WINAPI d3drm_frame3_QueryInterface(IDirect3DRMFrame3 *iface, REFIID riid, void **out)
460 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
462 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
464 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame)
465 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
466 || IsEqualGUID(riid, &IID_IDirect3DRMVisual)
467 || IsEqualGUID(riid, &IID_IUnknown))
469 *out = &frame->IDirect3DRMFrame_iface;
471 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
473 *out = &frame->IDirect3DRMFrame2_iface;
475 else if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
477 *out = &frame->IDirect3DRMFrame3_iface;
479 else
481 *out = NULL;
482 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
483 return CLASS_E_CLASSNOTAVAILABLE;
486 IUnknown_AddRef((IUnknown *)*out);
487 return S_OK;
490 static HRESULT WINAPI d3drm_frame2_QueryInterface(IDirect3DRMFrame2 *iface, REFIID riid, void **out)
492 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
494 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
496 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
499 static HRESULT WINAPI d3drm_frame1_QueryInterface(IDirect3DRMFrame *iface, REFIID riid, void **out)
501 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
503 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
505 return d3drm_frame3_QueryInterface(&frame->IDirect3DRMFrame3_iface, riid, out);
508 static ULONG WINAPI d3drm_frame3_AddRef(IDirect3DRMFrame3 *iface)
510 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
511 ULONG refcount = InterlockedIncrement(&frame->ref);
513 TRACE("%p increasing refcount to %u.\n", iface, refcount);
515 return refcount;
518 static ULONG WINAPI d3drm_frame2_AddRef(IDirect3DRMFrame2 *iface)
520 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
522 TRACE("iface %p.\n", iface);
524 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
527 static ULONG WINAPI d3drm_frame1_AddRef(IDirect3DRMFrame *iface)
529 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
531 TRACE("iface %p.\n", iface);
533 return d3drm_frame3_AddRef(&frame->IDirect3DRMFrame3_iface);
536 static ULONG WINAPI d3drm_frame3_Release(IDirect3DRMFrame3 *iface)
538 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
539 ULONG refcount = InterlockedDecrement(&frame->ref);
540 ULONG i;
542 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
544 if (!refcount)
546 d3drm_object_cleanup((IDirect3DRMObject *)&frame->IDirect3DRMFrame_iface, &frame->obj);
547 for (i = 0; i < frame->nb_children; ++i)
549 IDirect3DRMFrame3_Release(frame->children[i]);
551 HeapFree(GetProcessHeap(), 0, frame->children);
552 for (i = 0; i < frame->nb_visuals; ++i)
554 IDirect3DRMVisual_Release(frame->visuals[i]);
556 HeapFree(GetProcessHeap(), 0, frame->visuals);
557 for (i = 0; i < frame->nb_lights; ++i)
559 IDirect3DRMLight_Release(frame->lights[i]);
561 HeapFree(GetProcessHeap(), 0, frame->lights);
562 IDirect3DRM_Release(frame->d3drm);
563 HeapFree(GetProcessHeap(), 0, frame);
566 return refcount;
569 static ULONG WINAPI d3drm_frame2_Release(IDirect3DRMFrame2 *iface)
571 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
573 TRACE("iface %p.\n", iface);
575 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
578 static ULONG WINAPI d3drm_frame1_Release(IDirect3DRMFrame *iface)
580 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
582 TRACE("iface %p.\n", iface);
584 return d3drm_frame3_Release(&frame->IDirect3DRMFrame3_iface);
587 static HRESULT WINAPI d3drm_frame3_Clone(IDirect3DRMFrame3 *iface,
588 IUnknown *outer, REFIID iid, void **out)
590 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
592 return E_NOTIMPL;
595 static HRESULT WINAPI d3drm_frame2_Clone(IDirect3DRMFrame2 *iface,
596 IUnknown *outer, REFIID iid, void **out)
598 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
600 return E_NOTIMPL;
603 static HRESULT WINAPI d3drm_frame1_Clone(IDirect3DRMFrame *iface,
604 IUnknown *outer, REFIID iid, void **out)
606 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
608 return E_NOTIMPL;
611 static HRESULT WINAPI d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3 *iface,
612 D3DRMOBJECTCALLBACK cb, void *ctx)
614 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
616 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
618 return d3drm_object_add_destroy_callback(&frame->obj, cb, ctx);
621 static HRESULT WINAPI d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2 *iface,
622 D3DRMOBJECTCALLBACK cb, void *ctx)
624 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
626 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
628 return IDirect3DRMFrame3_AddDestroyCallback(&frame->IDirect3DRMFrame3_iface, cb, ctx);
631 static HRESULT WINAPI d3drm_frame1_AddDestroyCallback(IDirect3DRMFrame *iface,
632 D3DRMOBJECTCALLBACK cb, void *ctx)
634 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
636 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
638 return IDirect3DRMFrame3_AddDestroyCallback(&frame->IDirect3DRMFrame3_iface, cb, ctx);
641 static HRESULT WINAPI d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3 *iface,
642 D3DRMOBJECTCALLBACK cb, void *ctx)
644 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
646 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
648 return d3drm_object_delete_destroy_callback(&frame->obj, cb, ctx);
651 static HRESULT WINAPI d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2 *iface,
652 D3DRMOBJECTCALLBACK cb, void *ctx)
654 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
656 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
658 return IDirect3DRMFrame3_DeleteDestroyCallback(&frame->IDirect3DRMFrame3_iface, cb, ctx);
661 static HRESULT WINAPI d3drm_frame1_DeleteDestroyCallback(IDirect3DRMFrame *iface,
662 D3DRMOBJECTCALLBACK cb, void *ctx)
664 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
666 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
668 return IDirect3DRMFrame3_DeleteDestroyCallback(&frame->IDirect3DRMFrame3_iface, cb, ctx);
671 static HRESULT WINAPI d3drm_frame3_SetAppData(IDirect3DRMFrame3 *iface, DWORD data)
673 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
675 TRACE("iface %p, data %#x.\n", iface, data);
677 frame->obj.appdata = data;
679 return D3DRM_OK;
682 static HRESULT WINAPI d3drm_frame2_SetAppData(IDirect3DRMFrame2 *iface, DWORD data)
684 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
686 TRACE("iface %p, data %#x.\n", iface, data);
688 return d3drm_frame3_SetAppData(&frame->IDirect3DRMFrame3_iface, data);
691 static HRESULT WINAPI d3drm_frame1_SetAppData(IDirect3DRMFrame *iface, DWORD data)
693 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
695 TRACE("iface %p, data %#x.\n", iface, data);
697 return d3drm_frame3_SetAppData(&frame->IDirect3DRMFrame3_iface, data);
700 static DWORD WINAPI d3drm_frame3_GetAppData(IDirect3DRMFrame3 *iface)
702 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
704 TRACE("iface %p.\n", iface);
706 return frame->obj.appdata;
709 static DWORD WINAPI d3drm_frame2_GetAppData(IDirect3DRMFrame2 *iface)
711 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
713 TRACE("iface %p.\n", iface);
715 return d3drm_frame3_GetAppData(&frame->IDirect3DRMFrame3_iface);
718 static DWORD WINAPI d3drm_frame1_GetAppData(IDirect3DRMFrame *iface)
720 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
722 TRACE("iface %p.\n", iface);
724 return d3drm_frame3_GetAppData(&frame->IDirect3DRMFrame3_iface);
727 static HRESULT WINAPI d3drm_frame3_SetName(IDirect3DRMFrame3 *iface, const char *name)
729 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
731 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
733 return d3drm_object_set_name(&frame->obj, name);
736 static HRESULT WINAPI d3drm_frame2_SetName(IDirect3DRMFrame2 *iface, const char *name)
738 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
740 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
742 return d3drm_frame3_SetName(&frame->IDirect3DRMFrame3_iface, name);
745 static HRESULT WINAPI d3drm_frame1_SetName(IDirect3DRMFrame *iface, const char *name)
747 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
749 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
751 return d3drm_frame3_SetName(&frame->IDirect3DRMFrame3_iface, name);
754 static HRESULT WINAPI d3drm_frame3_GetName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
756 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
758 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
760 return d3drm_object_get_name(&frame->obj, size, name);
763 static HRESULT WINAPI d3drm_frame2_GetName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
765 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
767 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
769 return d3drm_frame3_GetName(&frame->IDirect3DRMFrame3_iface, size, name);
772 static HRESULT WINAPI d3drm_frame1_GetName(IDirect3DRMFrame *iface, DWORD *size, char *name)
774 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
776 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
778 return d3drm_frame3_GetName(&frame->IDirect3DRMFrame3_iface, size, name);
781 static HRESULT WINAPI d3drm_frame3_GetClassName(IDirect3DRMFrame3 *iface, DWORD *size, char *name)
783 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
785 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
787 return d3drm_object_get_class_name(&frame->obj, size, name);
790 static HRESULT WINAPI d3drm_frame2_GetClassName(IDirect3DRMFrame2 *iface, DWORD *size, char *name)
792 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
794 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
796 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
799 static HRESULT WINAPI d3drm_frame1_GetClassName(IDirect3DRMFrame *iface, DWORD *size, char *name)
801 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
803 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
805 return d3drm_frame3_GetClassName(&frame->IDirect3DRMFrame3_iface, size, name);
808 static HRESULT WINAPI d3drm_frame3_AddChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
810 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
811 struct d3drm_frame *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
813 TRACE("iface %p, child %p.\n", iface, child);
815 if (!child_obj)
816 return D3DRMERR_BADOBJECT;
818 if (child_obj->parent)
820 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
822 if (parent == iface)
824 /* Passed frame is already a child so return success */
825 return D3DRM_OK;
827 else
829 /* Remove parent and continue */
830 IDirect3DRMFrame3_DeleteChild(parent, child);
834 if ((This->nb_children + 1) > This->children_capacity)
836 ULONG new_capacity;
837 IDirect3DRMFrame3** children;
839 if (!This->children_capacity)
841 new_capacity = 16;
842 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
844 else
846 new_capacity = This->children_capacity * 2;
847 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
850 if (!children)
851 return E_OUTOFMEMORY;
853 This->children_capacity = new_capacity;
854 This->children = children;
857 This->children[This->nb_children++] = child;
858 IDirect3DRMFrame3_AddRef(child);
859 child_obj->parent = This;
861 return D3DRM_OK;
864 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
866 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
867 IDirect3DRMFrame3 *child3;
868 HRESULT hr;
870 TRACE("iface %p, child %p.\n", iface, child);
872 if (!child)
873 return D3DRMERR_BADOBJECT;
874 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
875 if (hr != S_OK)
876 return D3DRMERR_BADOBJECT;
877 IDirect3DRMFrame_Release(child);
879 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
882 static HRESULT WINAPI d3drm_frame1_AddChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
884 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
885 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
887 TRACE("iface %p, child %p.\n", iface, child);
889 if (!child_frame)
890 return D3DRMERR_BADOBJECT;
892 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
895 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
897 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
898 ULONG i;
899 IDirect3DRMLight** lights;
901 TRACE("iface %p, light %p.\n", iface, light);
903 if (!light)
904 return D3DRMERR_BADOBJECT;
906 /* Check if already existing and return gracefully without increasing ref count */
907 for (i = 0; i < This->nb_lights; i++)
908 if (This->lights[i] == light)
909 return D3DRM_OK;
911 if ((This->nb_lights + 1) > This->lights_capacity)
913 ULONG new_capacity;
915 if (!This->lights_capacity)
917 new_capacity = 16;
918 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
920 else
922 new_capacity = This->lights_capacity * 2;
923 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
926 if (!lights)
927 return E_OUTOFMEMORY;
929 This->lights_capacity = new_capacity;
930 This->lights = lights;
933 This->lights[This->nb_lights++] = light;
934 IDirect3DRMLight_AddRef(light);
936 return D3DRM_OK;
939 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
941 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
943 TRACE("iface %p, light %p.\n", iface, light);
945 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
948 static HRESULT WINAPI d3drm_frame1_AddLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
950 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
952 TRACE("iface %p, light %p.\n", iface, light);
954 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
957 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
958 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
960 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
962 return E_NOTIMPL;
965 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
966 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
968 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
970 return E_NOTIMPL;
973 static HRESULT WINAPI d3drm_frame1_AddMoveCallback(IDirect3DRMFrame *iface,
974 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
976 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
978 return E_NOTIMPL;
981 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
982 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
984 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
986 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
988 switch (type)
990 case D3DRMCOMBINE_REPLACE:
991 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
992 break;
994 case D3DRMCOMBINE_BEFORE:
995 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
996 break;
998 case D3DRMCOMBINE_AFTER:
999 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
1000 break;
1002 default:
1003 WARN("Unknown Combine Type %u\n", type);
1004 return D3DRMERR_BADVALUE;
1007 return S_OK;
1010 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface,
1011 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
1013 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1015 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
1017 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
1020 static HRESULT WINAPI d3drm_frame1_AddTransform(IDirect3DRMFrame *iface,
1021 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
1023 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1025 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
1027 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
1030 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
1031 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1033 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1035 return E_NOTIMPL;
1038 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
1039 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1041 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1043 return E_NOTIMPL;
1046 static HRESULT WINAPI d3drm_frame1_AddTranslation(IDirect3DRMFrame *iface,
1047 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1049 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1051 return E_NOTIMPL;
1054 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1055 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1057 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1059 return E_NOTIMPL;
1062 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
1063 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1065 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1067 return E_NOTIMPL;
1070 static HRESULT WINAPI d3drm_frame1_AddScale(IDirect3DRMFrame *iface,
1071 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1073 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1075 return E_NOTIMPL;
1078 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1079 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1081 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1082 iface, type, x, y, z, theta);
1084 return E_NOTIMPL;
1087 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
1088 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1090 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1092 return E_NOTIMPL;
1095 static HRESULT WINAPI d3drm_frame1_AddRotation(IDirect3DRMFrame *iface,
1096 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1098 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1100 return E_NOTIMPL;
1103 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1105 struct d3drm_frame *This = impl_from_IDirect3DRMFrame3(iface);
1106 ULONG i;
1107 IDirect3DRMVisual** visuals;
1109 TRACE("iface %p, visual %p.\n", iface, visual);
1111 if (!visual)
1112 return D3DRMERR_BADOBJECT;
1114 /* Check if already existing and return gracefully without increasing ref count */
1115 for (i = 0; i < This->nb_visuals; i++)
1116 if (This->visuals[i] == (IDirect3DRMVisual *)visual)
1117 return D3DRM_OK;
1119 if ((This->nb_visuals + 1) > This->visuals_capacity)
1121 ULONG new_capacity;
1123 if (!This->visuals_capacity)
1125 new_capacity = 16;
1126 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1128 else
1130 new_capacity = This->visuals_capacity * 2;
1131 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1134 if (!visuals)
1135 return E_OUTOFMEMORY;
1137 This->visuals_capacity = new_capacity;
1138 This->visuals = visuals;
1141 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual *)visual;
1142 IDirect3DRMVisual_AddRef(visual);
1144 return D3DRM_OK;
1147 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1149 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1151 TRACE("iface %p, visual %p.\n", iface, visual);
1153 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1156 static HRESULT WINAPI d3drm_frame1_AddVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1158 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1160 TRACE("iface %p, visual %p.\n", iface, visual);
1162 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1165 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1167 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1168 struct d3drm_frame_array *array;
1170 TRACE("iface %p, children %p.\n", iface, children);
1172 if (!children)
1173 return D3DRMERR_BADVALUE;
1175 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1176 return E_OUTOFMEMORY;
1178 *children = &array->IDirect3DRMFrameArray_iface;
1180 return D3DRM_OK;
1183 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
1185 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1187 TRACE("iface %p, children %p.\n", iface, children);
1189 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1192 static HRESULT WINAPI d3drm_frame1_GetChildren(IDirect3DRMFrame *iface, IDirect3DRMFrameArray **children)
1194 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1196 TRACE("iface %p, children %p.\n", iface, children);
1198 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1201 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1203 FIXME("iface %p stub!\n", iface);
1205 return 0;
1208 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
1210 FIXME("iface %p stub!\n", iface);
1212 return 0;
1215 static D3DCOLOR WINAPI d3drm_frame1_GetColor(IDirect3DRMFrame *iface)
1217 FIXME("iface %p stub!\n", iface);
1219 return 0;
1222 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1224 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1225 struct d3drm_light_array *array;
1227 TRACE("iface %p, lights %p.\n", iface, lights);
1229 if (!lights)
1230 return D3DRMERR_BADVALUE;
1232 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1233 return E_OUTOFMEMORY;
1235 *lights = &array->IDirect3DRMLightArray_iface;
1237 return D3DRM_OK;
1240 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
1242 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1244 TRACE("iface %p, lights %p.\n", iface, lights);
1246 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1249 static HRESULT WINAPI d3drm_frame1_GetLights(IDirect3DRMFrame *iface, IDirect3DRMLightArray **lights)
1251 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1253 TRACE("iface %p, lights %p.\n", iface, lights);
1255 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1258 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1260 FIXME("iface %p stub!\n", iface);
1262 return D3DRMMATERIAL_FROMPARENT;
1265 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
1267 FIXME("iface %p stub!\n", iface);
1269 return D3DRMMATERIAL_FROMPARENT;
1272 static D3DRMMATERIALMODE WINAPI d3drm_frame1_GetMaterialMode(IDirect3DRMFrame *iface)
1274 FIXME("iface %p stub!\n", iface);
1276 return D3DRMMATERIAL_FROMPARENT;
1279 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1281 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1283 TRACE("iface %p, parent %p.\n", iface, parent);
1285 if (!parent)
1286 return D3DRMERR_BADVALUE;
1288 if (frame->parent)
1290 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1291 IDirect3DRMFrame_AddRef(*parent);
1293 else
1295 *parent = NULL;
1298 return D3DRM_OK;
1301 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
1303 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1305 TRACE("iface %p, parent %p.\n", iface, parent);
1307 if (!parent)
1308 return D3DRMERR_BADVALUE;
1310 if (frame->parent)
1312 *parent = &frame->parent->IDirect3DRMFrame_iface;
1313 IDirect3DRMFrame_AddRef(*parent);
1315 else
1317 *parent = NULL;
1320 return D3DRM_OK;
1323 static HRESULT WINAPI d3drm_frame1_GetParent(IDirect3DRMFrame *iface, IDirect3DRMFrame **parent)
1325 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1327 TRACE("iface %p, parent %p.\n", iface, parent);
1329 return d3drm_frame2_GetParent(&frame->IDirect3DRMFrame2_iface, parent);
1332 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1333 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1335 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1337 return E_NOTIMPL;
1340 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
1341 IDirect3DRMFrame *reference, D3DVECTOR *position)
1343 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1345 return E_NOTIMPL;
1348 static HRESULT WINAPI d3drm_frame1_GetPosition(IDirect3DRMFrame *iface,
1349 IDirect3DRMFrame *reference, D3DVECTOR *position)
1351 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1353 return E_NOTIMPL;
1357 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1358 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1360 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1362 return E_NOTIMPL;
1365 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
1366 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1368 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1370 return E_NOTIMPL;
1373 static HRESULT WINAPI d3drm_frame1_GetRotation(IDirect3DRMFrame *iface,
1374 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1376 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1378 return E_NOTIMPL;
1381 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1383 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1385 TRACE("iface %p, scene %p.\n", iface, scene);
1387 if (!scene)
1388 return D3DRMERR_BADVALUE;
1390 while (frame->parent)
1391 frame = frame->parent;
1393 *scene = &frame->IDirect3DRMFrame3_iface;
1394 IDirect3DRMFrame3_AddRef(*scene);
1396 return D3DRM_OK;
1399 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
1401 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1402 IDirect3DRMFrame3 *frame3;
1403 HRESULT hr;
1405 TRACE("iface %p, scene %p.\n", iface, scene);
1407 if (!scene)
1408 return D3DRMERR_BADVALUE;
1410 hr = IDirect3DRMFrame3_GetScene(&frame->IDirect3DRMFrame3_iface, &frame3);
1411 if (FAILED(hr) || !frame3)
1413 *scene = NULL;
1414 return hr;
1417 hr = IDirect3DRMFrame3_QueryInterface(frame3, &IID_IDirect3DRMFrame, (void **)scene);
1418 IDirect3DRMFrame3_Release(frame3);
1420 return hr;
1423 static HRESULT WINAPI d3drm_frame1_GetScene(IDirect3DRMFrame *iface, IDirect3DRMFrame **scene)
1425 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1427 TRACE("iface %p, scene %p.\n", iface, scene);
1429 return d3drm_frame2_GetScene(&frame->IDirect3DRMFrame2_iface, scene);
1432 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1434 FIXME("iface %p stub!\n", iface);
1436 return D3DRMSORT_FROMPARENT;
1439 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
1441 FIXME("iface %p stub!\n", iface);
1443 return D3DRMSORT_FROMPARENT;
1446 static D3DRMSORTMODE WINAPI d3drm_frame1_GetSortMode(IDirect3DRMFrame *iface)
1448 FIXME("iface %p stub!\n", iface);
1450 return D3DRMSORT_FROMPARENT;
1453 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1455 FIXME("iface %p, texture %p stub!\n", iface, texture);
1457 return E_NOTIMPL;
1460 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
1462 FIXME("iface %p, texture %p stub!\n", iface, texture);
1464 return E_NOTIMPL;
1467 static HRESULT WINAPI d3drm_frame1_GetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture **texture)
1469 FIXME("iface %p, texture %p stub!\n", iface, texture);
1471 return E_NOTIMPL;
1474 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1475 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1477 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1479 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1481 if (reference)
1482 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1484 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1486 return D3DRM_OK;
1489 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
1491 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1493 TRACE("iface %p, matrix %p.\n", iface, matrix);
1495 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1497 return D3DRM_OK;
1500 static HRESULT WINAPI d3drm_frame1_GetTransform(IDirect3DRMFrame *iface, D3DRMMATRIX4D matrix)
1502 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1504 TRACE("iface %p, matrix %p.\n", iface, matrix);
1506 return d3drm_frame2_GetTransform(&frame->IDirect3DRMFrame2_iface, matrix);
1509 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1510 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1512 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1513 iface, reference, velocity, with_rotation);
1515 return E_NOTIMPL;
1518 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
1519 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1521 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1522 iface, reference, velocity, with_rotation);
1524 return E_NOTIMPL;
1527 static HRESULT WINAPI d3drm_frame1_GetVelocity(IDirect3DRMFrame *iface,
1528 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1530 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1531 iface, reference, velocity, with_rotation);
1533 return E_NOTIMPL;
1536 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1537 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1539 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1541 return E_NOTIMPL;
1544 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
1545 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1547 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1549 return E_NOTIMPL;
1552 static HRESULT WINAPI d3drm_frame1_GetOrientation(IDirect3DRMFrame *iface,
1553 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1555 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1557 return E_NOTIMPL;
1560 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface, DWORD *count, IUnknown **visuals)
1562 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1564 return E_NOTIMPL;
1567 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
1569 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1570 struct d3drm_visual_array *array;
1572 TRACE("iface %p, visuals %p.\n", iface, visuals);
1574 if (!visuals)
1575 return D3DRMERR_BADVALUE;
1577 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
1578 return E_OUTOFMEMORY;
1580 *visuals = &array->IDirect3DRMVisualArray_iface;
1582 return D3DRM_OK;
1585 static HRESULT WINAPI d3drm_frame1_GetVisuals(IDirect3DRMFrame *iface, IDirect3DRMVisualArray **visuals)
1587 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1589 TRACE("iface %p, visuals %p.\n", iface, visuals);
1591 return d3drm_frame2_GetVisuals(&frame->IDirect3DRMFrame2_iface, visuals);
1594 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
1596 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1598 return E_NOTIMPL;
1601 static HRESULT WINAPI d3drm_frame1_GetTextureTopology(IDirect3DRMFrame *iface, BOOL *wrap_u, BOOL *wrap_v)
1603 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1605 return E_NOTIMPL;
1608 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1610 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1612 return E_NOTIMPL;
1615 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1617 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1619 return E_NOTIMPL;
1622 static HRESULT WINAPI d3drm_frame1_InverseTransform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
1624 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1626 return E_NOTIMPL;
1629 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1630 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1632 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1633 iface, filename, name, flags, cb, ctx);
1635 return E_NOTIMPL;
1638 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
1639 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1641 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1642 iface, filename, name, flags, cb, ctx);
1644 return E_NOTIMPL;
1647 static HRESULT WINAPI d3drm_frame1_Load(IDirect3DRMFrame *iface, void *filename,
1648 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1650 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1651 iface, filename, name, flags, cb, ctx);
1653 return E_NOTIMPL;
1656 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1657 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1659 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1661 return E_NOTIMPL;
1664 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
1665 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1667 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1669 return E_NOTIMPL;
1672 static HRESULT WINAPI d3drm_frame1_LookAt(IDirect3DRMFrame *iface, IDirect3DRMFrame *target,
1673 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1675 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1677 return E_NOTIMPL;
1680 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1682 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1684 return E_NOTIMPL;
1687 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
1689 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1691 return E_NOTIMPL;
1694 static HRESULT WINAPI d3drm_frame1_Move(IDirect3DRMFrame *iface, D3DVALUE delta)
1696 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1698 return E_NOTIMPL;
1701 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1703 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1704 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1705 ULONG i;
1707 TRACE("iface %p, child %p.\n", iface, child);
1709 if (!child_impl)
1710 return D3DRMERR_BADOBJECT;
1712 /* Check if child exists */
1713 for (i = 0; i < frame->nb_children; ++i)
1715 if (frame->children[i] == child)
1716 break;
1719 if (i == frame->nb_children)
1720 return D3DRMERR_BADVALUE;
1722 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1723 IDirect3DRMFrame3_Release(child);
1724 child_impl->parent = NULL;
1725 --frame->nb_children;
1727 return D3DRM_OK;
1730 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
1732 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1733 IDirect3DRMFrame3 *child3;
1734 HRESULT hr;
1736 TRACE("iface %p, child %p.\n", iface, child);
1738 if (!child)
1739 return D3DRMERR_BADOBJECT;
1740 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
1741 return D3DRMERR_BADOBJECT;
1742 IDirect3DRMFrame_Release(child);
1744 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
1747 static HRESULT WINAPI d3drm_frame1_DeleteChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
1749 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1750 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
1752 TRACE("iface %p, child %p.\n", iface, child);
1754 if (!child_frame)
1755 return D3DRMERR_BADOBJECT;
1757 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
1760 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1762 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1763 ULONG i;
1765 TRACE("iface %p, light %p.\n", iface, light);
1767 if (!light)
1768 return D3DRMERR_BADOBJECT;
1770 /* Check if visual exists */
1771 for (i = 0; i < frame->nb_lights; ++i)
1773 if (frame->lights[i] == light)
1774 break;
1777 if (i == frame->nb_lights)
1778 return D3DRMERR_BADVALUE;
1780 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1781 IDirect3DRMLight_Release(light);
1782 --frame->nb_lights;
1784 return D3DRM_OK;
1787 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
1789 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1791 TRACE("iface %p, light %p.\n", iface, light);
1793 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1796 static HRESULT WINAPI d3drm_frame1_DeleteLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
1798 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1800 TRACE("iface %p, light %p.\n", iface, light);
1802 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1805 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1806 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1808 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1810 return E_NOTIMPL;
1813 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
1814 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1816 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1818 return E_NOTIMPL;
1821 static HRESULT WINAPI d3drm_frame1_DeleteMoveCallback(IDirect3DRMFrame *iface,
1822 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1824 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1826 return E_NOTIMPL;
1829 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1831 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1832 ULONG i;
1834 TRACE("iface %p, visual %p.\n", iface, visual);
1836 if (!visual)
1837 return D3DRMERR_BADOBJECT;
1839 /* Check if visual exists */
1840 for (i = 0; i < frame->nb_visuals; ++i)
1842 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1843 break;
1846 if (i == frame->nb_visuals)
1847 return D3DRMERR_BADVALUE;
1849 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1850 IDirect3DRMVisual_Release(visual);
1851 --frame->nb_visuals;
1853 return D3DRM_OK;
1856 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1858 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1860 TRACE("iface %p, visual %p.\n", iface, visual);
1862 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1865 static HRESULT WINAPI d3drm_frame1_DeleteVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1867 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1869 TRACE("iface %p, visual %p.\n", iface, visual);
1871 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1874 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1876 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1878 TRACE("iface %p.\n", iface);
1880 return frame->scenebackground;
1883 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
1885 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1887 TRACE("iface %p.\n", iface);
1889 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1892 static D3DCOLOR WINAPI d3drm_frame1_GetSceneBackground(IDirect3DRMFrame *iface)
1894 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1896 TRACE("iface %p.\n", iface);
1898 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1901 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1902 IDirectDrawSurface **surface)
1904 FIXME("iface %p, surface %p stub!\n", iface, surface);
1906 return E_NOTIMPL;
1909 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
1910 IDirectDrawSurface **surface)
1912 FIXME("iface %p, surface %p stub!\n", iface, surface);
1914 return E_NOTIMPL;
1917 static HRESULT WINAPI d3drm_frame1_GetSceneBackgroundDepth(IDirect3DRMFrame *iface,
1918 IDirectDrawSurface **surface)
1920 FIXME("iface %p, surface %p stub!\n", iface, surface);
1922 return E_NOTIMPL;
1925 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1927 FIXME("iface %p stub!\n", iface);
1929 return 0;
1932 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
1934 FIXME("iface %p stub!\n", iface);
1936 return 0;
1939 static D3DCOLOR WINAPI d3drm_frame1_GetSceneFogColor(IDirect3DRMFrame *iface)
1941 FIXME("iface %p stub!\n", iface);
1943 return 0;
1946 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1948 FIXME("iface %p stub!\n", iface);
1950 return FALSE;
1953 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
1955 FIXME("iface %p stub!\n", iface);
1957 return FALSE;
1960 static BOOL WINAPI d3drm_frame1_GetSceneFogEnable(IDirect3DRMFrame *iface)
1962 FIXME("iface %p stub!\n", iface);
1964 return FALSE;
1967 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1969 FIXME("iface %p stub!\n", iface);
1971 return D3DRMFOG_LINEAR;
1974 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
1976 FIXME("iface %p stub!\n", iface);
1978 return D3DRMFOG_LINEAR;
1981 static D3DRMFOGMODE WINAPI d3drm_frame1_GetSceneFogMode(IDirect3DRMFrame *iface)
1983 FIXME("iface %p stub!\n", iface);
1985 return D3DRMFOG_LINEAR;
1988 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1989 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1991 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1993 return E_NOTIMPL;
1996 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
1997 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1999 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
2001 return E_NOTIMPL;
2004 static HRESULT WINAPI d3drm_frame1_GetSceneFogParams(IDirect3DRMFrame *iface,
2005 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
2007 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
2009 return E_NOTIMPL;
2012 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2014 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
2016 TRACE("iface %p, color 0x%08x.\n", iface, color);
2018 frame->scenebackground = color;
2020 return D3DRM_OK;
2023 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2025 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
2027 TRACE("iface %p, color 0x%08x.\n", iface, color);
2029 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
2032 static HRESULT WINAPI d3drm_frame1_SetSceneBackground(IDirect3DRMFrame *iface, D3DCOLOR color)
2034 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
2036 TRACE("iface %p, color 0x%08x.\n", iface, color);
2038 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
2041 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
2042 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2044 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
2046 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2048 d3drm_set_color(&frame->scenebackground, red, green, blue, 1.0f);
2050 return D3DRM_OK;
2053 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
2054 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2056 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
2058 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2060 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2063 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundRGB(IDirect3DRMFrame *iface,
2064 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2066 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
2068 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2070 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2073 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
2074 IDirectDrawSurface *surface)
2076 FIXME("iface %p, surface %p stub!\n", iface, surface);
2078 return E_NOTIMPL;
2081 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
2082 IDirectDrawSurface *surface)
2084 FIXME("iface %p, surface %p stub!\n", iface, surface);
2086 return E_NOTIMPL;
2089 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *iface,
2090 IDirectDrawSurface *surface)
2092 FIXME("iface %p, surface %p stub!\n", iface, surface);
2094 return E_NOTIMPL;
2097 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
2098 IDirect3DRMTexture3 *texture)
2100 FIXME("iface %p, texture %p stub!\n", iface, texture);
2102 return E_NOTIMPL;
2105 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
2106 IDirect3DRMTexture *texture)
2108 FIXME("iface %p, texture %p stub!\n", iface, texture);
2110 return E_NOTIMPL;
2113 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface,
2114 IDirect3DRMTexture *texture)
2116 FIXME("iface %p, texture %p stub!\n", iface, texture);
2118 return E_NOTIMPL;
2121 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2123 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2125 return E_NOTIMPL;
2128 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
2130 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2132 return E_NOTIMPL;
2135 static HRESULT WINAPI d3drm_frame1_SetSceneFogEnable(IDirect3DRMFrame *iface, BOOL enable)
2137 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2139 return E_NOTIMPL;
2142 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2144 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2146 return E_NOTIMPL;
2149 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2151 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2153 return E_NOTIMPL;
2156 static HRESULT WINAPI d3drm_frame1_SetSceneFogColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2158 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2160 return E_NOTIMPL;
2163 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
2165 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2167 return E_NOTIMPL;
2170 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
2172 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2174 return E_NOTIMPL;
2177 static HRESULT WINAPI d3drm_frame1_SetSceneFogMode(IDirect3DRMFrame *iface, D3DRMFOGMODE mode)
2179 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2181 return E_NOTIMPL;
2184 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
2185 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2187 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2189 return E_NOTIMPL;
2192 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
2193 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2195 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2197 return E_NOTIMPL;
2200 static HRESULT WINAPI d3drm_frame1_SetSceneFogParams(IDirect3DRMFrame *iface,
2201 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2203 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2205 return E_NOTIMPL;
2208 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2210 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2212 return E_NOTIMPL;
2215 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2217 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2219 return E_NOTIMPL;
2222 static HRESULT WINAPI d3drm_frame1_SetColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2224 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2226 return E_NOTIMPL;
2229 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
2230 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2232 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2234 return E_NOTIMPL;
2237 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
2238 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2240 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2242 return E_NOTIMPL;
2245 static HRESULT WINAPI d3drm_frame1_SetColorRGB(IDirect3DRMFrame *iface,
2246 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2248 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2250 return E_NOTIMPL;
2253 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
2255 FIXME("iface %p stub!\n", iface);
2257 return D3DRMZBUFFER_FROMPARENT;
2260 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
2262 FIXME("iface %p stub!\n", iface);
2264 return D3DRMZBUFFER_FROMPARENT;
2267 static D3DRMZBUFFERMODE WINAPI d3drm_frame1_GetZbufferMode(IDirect3DRMFrame *iface)
2269 FIXME("iface %p stub!\n", iface);
2271 return D3DRMZBUFFER_FROMPARENT;
2274 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
2276 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2278 return E_NOTIMPL;
2281 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
2283 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2285 return E_NOTIMPL;
2288 static HRESULT WINAPI d3drm_frame1_SetMaterialMode(IDirect3DRMFrame *iface, D3DRMMATERIALMODE mode)
2290 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2292 return E_NOTIMPL;
2295 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2296 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2298 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2299 iface, reference, dx, dy, dz, ux, uy, uz);
2301 return E_NOTIMPL;
2304 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
2305 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2307 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2308 iface, reference, dx, dy, dz, ux, uy, uz);
2310 return E_NOTIMPL;
2313 static HRESULT WINAPI d3drm_frame1_SetOrientation(IDirect3DRMFrame *iface, IDirect3DRMFrame *reference,
2314 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2316 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2317 iface, reference, dx, dy, dz, ux, uy, uz);
2319 return E_NOTIMPL;
2322 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
2323 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2325 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2327 return E_NOTIMPL;
2330 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
2331 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2333 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2335 return E_NOTIMPL;
2338 static HRESULT WINAPI d3drm_frame1_SetPosition(IDirect3DRMFrame *iface,
2339 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2341 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2343 return E_NOTIMPL;
2346 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
2347 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2349 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2350 iface, reference, x, y, z, theta);
2352 return E_NOTIMPL;
2355 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
2356 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2358 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2359 iface, reference, x, y, z, theta);
2361 return E_NOTIMPL;
2364 static HRESULT WINAPI d3drm_frame1_SetRotation(IDirect3DRMFrame *iface,
2365 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2367 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2368 iface, reference, x, y, z, theta);
2370 return E_NOTIMPL;
2373 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
2375 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2377 return E_NOTIMPL;
2380 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
2382 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2384 return E_NOTIMPL;
2387 static HRESULT WINAPI d3drm_frame1_SetSortMode(IDirect3DRMFrame *iface, D3DRMSORTMODE mode)
2389 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2391 return E_NOTIMPL;
2394 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
2396 FIXME("iface %p, texture %p stub!\n", iface, texture);
2398 return E_NOTIMPL;
2401 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
2403 FIXME("iface %p, texture %p stub!\n", iface, texture);
2405 return E_NOTIMPL;
2408 static HRESULT WINAPI d3drm_frame1_SetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
2410 FIXME("iface %p, texture %p stub!\n", iface, texture);
2412 return E_NOTIMPL;
2415 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
2417 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2419 return E_NOTIMPL;
2422 static HRESULT WINAPI d3drm_frame1_SetTextureTopology(IDirect3DRMFrame *iface, BOOL wrap_u, BOOL wrap_v)
2424 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2426 return E_NOTIMPL;
2429 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
2430 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2432 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
2433 iface, reference, x, y, z, with_rotation);
2435 return E_NOTIMPL;
2438 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
2439 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2441 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2442 iface, reference, x, y, z, with_rotation);
2444 return E_NOTIMPL;
2447 static HRESULT WINAPI d3drm_frame1_SetVelocity(IDirect3DRMFrame *iface,
2448 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2450 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2451 iface, reference, x, y, z, with_rotation);
2453 return E_NOTIMPL;
2456 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
2458 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2460 return E_NOTIMPL;
2463 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
2465 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2467 return E_NOTIMPL;
2470 static HRESULT WINAPI d3drm_frame1_SetZbufferMode(IDirect3DRMFrame *iface, D3DRMZBUFFERMODE mode)
2472 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2474 return E_NOTIMPL;
2477 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
2479 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2481 return E_NOTIMPL;
2484 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
2486 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2488 return E_NOTIMPL;
2491 static HRESULT WINAPI d3drm_frame1_Transform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
2493 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2495 return E_NOTIMPL;
2498 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
2499 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
2501 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
2503 return E_NOTIMPL;
2506 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2508 FIXME("iface %p, box %p stub!\n", iface, box);
2510 return E_NOTIMPL;
2513 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2515 FIXME("iface %p, box %p stub!\n", iface, box);
2517 return E_NOTIMPL;
2520 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2522 FIXME("iface %p stub!\n", iface);
2524 return FALSE;
2527 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
2529 FIXME("iface %p stub!\n", iface);
2531 return FALSE;
2534 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2536 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2538 return E_NOTIMPL;
2541 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2543 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2545 return E_NOTIMPL;
2548 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2550 FIXME("iface %p, material %p stub!\n", iface, material);
2552 return E_NOTIMPL;
2555 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
2557 FIXME("iface %p, material %p stub!\n", iface, material);
2559 return E_NOTIMPL;
2562 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2564 FIXME("iface %p stub!\n", iface);
2566 return FALSE;
2569 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
2571 FIXME("iface %p stub!\n", iface);
2573 return FALSE;
2576 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2578 FIXME("iface %p, box %p stub!\n", iface, box);
2580 return E_NOTIMPL;
2583 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2585 FIXME("iface %p, box %p stub!\n", iface, box);
2587 return E_NOTIMPL;
2590 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2592 FIXME("iface %p, box %p stub!\n", iface, box);
2594 return E_NOTIMPL;
2597 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2599 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2601 return E_NOTIMPL;
2604 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2605 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2607 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2608 iface, dx, dy, dz, ux, uy, uz);
2610 return E_NOTIMPL;
2613 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2615 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2617 return E_NOTIMPL;
2620 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2622 FIXME("iface %p, material %p stub!\n", iface, material);
2624 return E_NOTIMPL;
2627 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2628 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2630 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2632 return E_NOTIMPL;
2635 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2636 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2638 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2639 iface, reference, ray, flags, visuals);
2641 return E_NOTIMPL;
2644 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2645 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2647 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2648 iface, debugstr_a(filename), format, flags);
2650 return E_NOTIMPL;
2653 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2654 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2656 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2658 return E_NOTIMPL;
2661 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2662 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2664 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2666 return E_NOTIMPL;
2669 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD flags)
2671 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2673 return E_NOTIMPL;
2676 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *flags)
2678 FIXME("iface %p, flags %p stub!\n", iface, flags);
2680 return E_NOTIMPL;
2683 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2685 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2687 return E_NOTIMPL;
2690 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2692 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2694 return E_NOTIMPL;
2697 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2698 D3DRMMATERIALOVERRIDE *override)
2700 FIXME("iface %p, override %p stub!\n", iface, override);
2702 return E_NOTIMPL;
2705 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2706 D3DRMMATERIALOVERRIDE *override)
2708 FIXME("iface %p, override %p stub!\n", iface, override);
2710 return E_NOTIMPL;
2713 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2715 d3drm_frame3_QueryInterface,
2716 d3drm_frame3_AddRef,
2717 d3drm_frame3_Release,
2718 d3drm_frame3_Clone,
2719 d3drm_frame3_AddDestroyCallback,
2720 d3drm_frame3_DeleteDestroyCallback,
2721 d3drm_frame3_SetAppData,
2722 d3drm_frame3_GetAppData,
2723 d3drm_frame3_SetName,
2724 d3drm_frame3_GetName,
2725 d3drm_frame3_GetClassName,
2726 d3drm_frame3_AddChild,
2727 d3drm_frame3_AddLight,
2728 d3drm_frame3_AddMoveCallback,
2729 d3drm_frame3_AddTransform,
2730 d3drm_frame3_AddTranslation,
2731 d3drm_frame3_AddScale,
2732 d3drm_frame3_AddRotation,
2733 d3drm_frame3_AddVisual,
2734 d3drm_frame3_GetChildren,
2735 d3drm_frame3_GetColor,
2736 d3drm_frame3_GetLights,
2737 d3drm_frame3_GetMaterialMode,
2738 d3drm_frame3_GetParent,
2739 d3drm_frame3_GetPosition,
2740 d3drm_frame3_GetRotation,
2741 d3drm_frame3_GetScene,
2742 d3drm_frame3_GetSortMode,
2743 d3drm_frame3_GetTexture,
2744 d3drm_frame3_GetTransform,
2745 d3drm_frame3_GetVelocity,
2746 d3drm_frame3_GetOrientation,
2747 d3drm_frame3_GetVisuals,
2748 d3drm_frame3_InverseTransform,
2749 d3drm_frame3_Load,
2750 d3drm_frame3_LookAt,
2751 d3drm_frame3_Move,
2752 d3drm_frame3_DeleteChild,
2753 d3drm_frame3_DeleteLight,
2754 d3drm_frame3_DeleteMoveCallback,
2755 d3drm_frame3_DeleteVisual,
2756 d3drm_frame3_GetSceneBackground,
2757 d3drm_frame3_GetSceneBackgroundDepth,
2758 d3drm_frame3_GetSceneFogColor,
2759 d3drm_frame3_GetSceneFogEnable,
2760 d3drm_frame3_GetSceneFogMode,
2761 d3drm_frame3_GetSceneFogParams,
2762 d3drm_frame3_SetSceneBackground,
2763 d3drm_frame3_SetSceneBackgroundRGB,
2764 d3drm_frame3_SetSceneBackgroundDepth,
2765 d3drm_frame3_SetSceneBackgroundImage,
2766 d3drm_frame3_SetSceneFogEnable,
2767 d3drm_frame3_SetSceneFogColor,
2768 d3drm_frame3_SetSceneFogMode,
2769 d3drm_frame3_SetSceneFogParams,
2770 d3drm_frame3_SetColor,
2771 d3drm_frame3_SetColorRGB,
2772 d3drm_frame3_GetZbufferMode,
2773 d3drm_frame3_SetMaterialMode,
2774 d3drm_frame3_SetOrientation,
2775 d3drm_frame3_SetPosition,
2776 d3drm_frame3_SetRotation,
2777 d3drm_frame3_SetSortMode,
2778 d3drm_frame3_SetTexture,
2779 d3drm_frame3_SetVelocity,
2780 d3drm_frame3_SetZbufferMode,
2781 d3drm_frame3_Transform,
2782 d3drm_frame3_GetBox,
2783 d3drm_frame3_GetBoxEnable,
2784 d3drm_frame3_GetAxes,
2785 d3drm_frame3_GetMaterial,
2786 d3drm_frame3_GetInheritAxes,
2787 d3drm_frame3_GetHierarchyBox,
2788 d3drm_frame3_SetBox,
2789 d3drm_frame3_SetBoxEnable,
2790 d3drm_frame3_SetAxes,
2791 d3drm_frame3_SetInheritAxes,
2792 d3drm_frame3_SetMaterial,
2793 d3drm_frame3_SetQuaternion,
2794 d3drm_frame3_RayPick,
2795 d3drm_frame3_Save,
2796 d3drm_frame3_TransformVectors,
2797 d3drm_frame3_InverseTransformVectors,
2798 d3drm_frame3_SetTraversalOptions,
2799 d3drm_frame3_GetTraversalOptions,
2800 d3drm_frame3_SetSceneFogMethod,
2801 d3drm_frame3_GetSceneFogMethod,
2802 d3drm_frame3_SetMaterialOverride,
2803 d3drm_frame3_GetMaterialOverride,
2806 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
2808 d3drm_frame2_QueryInterface,
2809 d3drm_frame2_AddRef,
2810 d3drm_frame2_Release,
2811 d3drm_frame2_Clone,
2812 d3drm_frame2_AddDestroyCallback,
2813 d3drm_frame2_DeleteDestroyCallback,
2814 d3drm_frame2_SetAppData,
2815 d3drm_frame2_GetAppData,
2816 d3drm_frame2_SetName,
2817 d3drm_frame2_GetName,
2818 d3drm_frame2_GetClassName,
2819 d3drm_frame2_AddChild,
2820 d3drm_frame2_AddLight,
2821 d3drm_frame2_AddMoveCallback,
2822 d3drm_frame2_AddTransform,
2823 d3drm_frame2_AddTranslation,
2824 d3drm_frame2_AddScale,
2825 d3drm_frame2_AddRotation,
2826 d3drm_frame2_AddVisual,
2827 d3drm_frame2_GetChildren,
2828 d3drm_frame2_GetColor,
2829 d3drm_frame2_GetLights,
2830 d3drm_frame2_GetMaterialMode,
2831 d3drm_frame2_GetParent,
2832 d3drm_frame2_GetPosition,
2833 d3drm_frame2_GetRotation,
2834 d3drm_frame2_GetScene,
2835 d3drm_frame2_GetSortMode,
2836 d3drm_frame2_GetTexture,
2837 d3drm_frame2_GetTransform,
2838 d3drm_frame2_GetVelocity,
2839 d3drm_frame2_GetOrientation,
2840 d3drm_frame2_GetVisuals,
2841 d3drm_frame2_GetTextureTopology,
2842 d3drm_frame2_InverseTransform,
2843 d3drm_frame2_Load,
2844 d3drm_frame2_LookAt,
2845 d3drm_frame2_Move,
2846 d3drm_frame2_DeleteChild,
2847 d3drm_frame2_DeleteLight,
2848 d3drm_frame2_DeleteMoveCallback,
2849 d3drm_frame2_DeleteVisual,
2850 d3drm_frame2_GetSceneBackground,
2851 d3drm_frame2_GetSceneBackgroundDepth,
2852 d3drm_frame2_GetSceneFogColor,
2853 d3drm_frame2_GetSceneFogEnable,
2854 d3drm_frame2_GetSceneFogMode,
2855 d3drm_frame2_GetSceneFogParams,
2856 d3drm_frame2_SetSceneBackground,
2857 d3drm_frame2_SetSceneBackgroundRGB,
2858 d3drm_frame2_SetSceneBackgroundDepth,
2859 d3drm_frame2_SetSceneBackgroundImage,
2860 d3drm_frame2_SetSceneFogEnable,
2861 d3drm_frame2_SetSceneFogColor,
2862 d3drm_frame2_SetSceneFogMode,
2863 d3drm_frame2_SetSceneFogParams,
2864 d3drm_frame2_SetColor,
2865 d3drm_frame2_SetColorRGB,
2866 d3drm_frame2_GetZbufferMode,
2867 d3drm_frame2_SetMaterialMode,
2868 d3drm_frame2_SetOrientation,
2869 d3drm_frame2_SetPosition,
2870 d3drm_frame2_SetRotation,
2871 d3drm_frame2_SetSortMode,
2872 d3drm_frame2_SetTexture,
2873 d3drm_frame2_SetTextureTopology,
2874 d3drm_frame2_SetVelocity,
2875 d3drm_frame2_SetZbufferMode,
2876 d3drm_frame2_Transform,
2877 d3drm_frame2_AddMoveCallback2,
2878 d3drm_frame2_GetBox,
2879 d3drm_frame2_GetBoxEnable,
2880 d3drm_frame2_GetAxes,
2881 d3drm_frame2_GetMaterial,
2882 d3drm_frame2_GetInheritAxes,
2883 d3drm_frame2_GetHierarchyBox,
2886 static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl =
2888 d3drm_frame1_QueryInterface,
2889 d3drm_frame1_AddRef,
2890 d3drm_frame1_Release,
2891 d3drm_frame1_Clone,
2892 d3drm_frame1_AddDestroyCallback,
2893 d3drm_frame1_DeleteDestroyCallback,
2894 d3drm_frame1_SetAppData,
2895 d3drm_frame1_GetAppData,
2896 d3drm_frame1_SetName,
2897 d3drm_frame1_GetName,
2898 d3drm_frame1_GetClassName,
2899 d3drm_frame1_AddChild,
2900 d3drm_frame1_AddLight,
2901 d3drm_frame1_AddMoveCallback,
2902 d3drm_frame1_AddTransform,
2903 d3drm_frame1_AddTranslation,
2904 d3drm_frame1_AddScale,
2905 d3drm_frame1_AddRotation,
2906 d3drm_frame1_AddVisual,
2907 d3drm_frame1_GetChildren,
2908 d3drm_frame1_GetColor,
2909 d3drm_frame1_GetLights,
2910 d3drm_frame1_GetMaterialMode,
2911 d3drm_frame1_GetParent,
2912 d3drm_frame1_GetPosition,
2913 d3drm_frame1_GetRotation,
2914 d3drm_frame1_GetScene,
2915 d3drm_frame1_GetSortMode,
2916 d3drm_frame1_GetTexture,
2917 d3drm_frame1_GetTransform,
2918 d3drm_frame1_GetVelocity,
2919 d3drm_frame1_GetOrientation,
2920 d3drm_frame1_GetVisuals,
2921 d3drm_frame1_GetTextureTopology,
2922 d3drm_frame1_InverseTransform,
2923 d3drm_frame1_Load,
2924 d3drm_frame1_LookAt,
2925 d3drm_frame1_Move,
2926 d3drm_frame1_DeleteChild,
2927 d3drm_frame1_DeleteLight,
2928 d3drm_frame1_DeleteMoveCallback,
2929 d3drm_frame1_DeleteVisual,
2930 d3drm_frame1_GetSceneBackground,
2931 d3drm_frame1_GetSceneBackgroundDepth,
2932 d3drm_frame1_GetSceneFogColor,
2933 d3drm_frame1_GetSceneFogEnable,
2934 d3drm_frame1_GetSceneFogMode,
2935 d3drm_frame1_GetSceneFogParams,
2936 d3drm_frame1_SetSceneBackground,
2937 d3drm_frame1_SetSceneBackgroundRGB,
2938 d3drm_frame1_SetSceneBackgroundDepth,
2939 d3drm_frame1_SetSceneBackgroundImage,
2940 d3drm_frame1_SetSceneFogEnable,
2941 d3drm_frame1_SetSceneFogColor,
2942 d3drm_frame1_SetSceneFogMode,
2943 d3drm_frame1_SetSceneFogParams,
2944 d3drm_frame1_SetColor,
2945 d3drm_frame1_SetColorRGB,
2946 d3drm_frame1_GetZbufferMode,
2947 d3drm_frame1_SetMaterialMode,
2948 d3drm_frame1_SetOrientation,
2949 d3drm_frame1_SetPosition,
2950 d3drm_frame1_SetRotation,
2951 d3drm_frame1_SetSortMode,
2952 d3drm_frame1_SetTexture,
2953 d3drm_frame1_SetTextureTopology,
2954 d3drm_frame1_SetVelocity,
2955 d3drm_frame1_SetZbufferMode,
2956 d3drm_frame1_Transform,
2959 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2961 if (!iface)
2962 return NULL;
2963 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2965 return impl_from_IDirect3DRMFrame3(iface);
2968 struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
2970 if (!iface)
2971 return NULL;
2972 assert(iface->lpVtbl == &d3drm_frame1_vtbl);
2974 return impl_from_IDirect3DRMFrame(iface);
2977 HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm)
2979 static const char classname[] = "Frame";
2980 struct d3drm_frame *object;
2981 HRESULT hr = D3DRM_OK;
2983 TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
2985 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
2986 return E_OUTOFMEMORY;
2988 object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
2989 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2990 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2991 object->d3drm = d3drm;
2992 object->ref = 1;
2993 d3drm_set_color(&object->scenebackground, 0.0f, 0.0f, 0.0f, 1.0f);
2995 d3drm_object_init(&object->obj, classname);
2997 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2999 if (parent_frame)
3001 IDirect3DRMFrame3 *p;
3003 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
3005 HeapFree(GetProcessHeap(), 0, object);
3006 return hr;
3008 IDirect3DRMFrame_Release(parent_frame);
3009 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
3012 IDirect3DRM_AddRef(object->d3drm);
3014 *frame = object;
3016 return hr;
3019 static HRESULT WINAPI d3drm_animation2_QueryInterface(IDirect3DRMAnimation2 *iface, REFIID riid, void **out)
3021 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3023 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
3025 if (IsEqualGUID(riid, &IID_IDirect3DRMAnimation)
3026 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
3027 || IsEqualGUID(riid, &IID_IUnknown))
3029 *out = &animation->IDirect3DRMAnimation_iface;
3031 else if (IsEqualGUID(riid, &IID_IDirect3DRMAnimation2))
3033 *out = &animation->IDirect3DRMAnimation2_iface;
3035 else
3037 *out = NULL;
3038 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
3039 return CLASS_E_CLASSNOTAVAILABLE;
3042 IUnknown_AddRef((IUnknown *)*out);
3043 return S_OK;
3046 static HRESULT WINAPI d3drm_animation1_QueryInterface(IDirect3DRMAnimation *iface, REFIID riid, void **out)
3048 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3050 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
3052 return IDirect3DRMAnimation2_QueryInterface(&animation->IDirect3DRMAnimation2_iface, riid, out);
3055 static ULONG WINAPI d3drm_animation2_AddRef(IDirect3DRMAnimation2 *iface)
3057 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3058 ULONG refcount = InterlockedIncrement(&animation->ref);
3060 TRACE("%p increasing refcount to %u.\n", iface, refcount);
3062 return refcount;
3065 static ULONG WINAPI d3drm_animation1_AddRef(IDirect3DRMAnimation *iface)
3067 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3068 return IDirect3DRMAnimation2_AddRef(&animation->IDirect3DRMAnimation2_iface);
3071 static ULONG WINAPI d3drm_animation2_Release(IDirect3DRMAnimation2 *iface)
3073 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3074 ULONG refcount = InterlockedDecrement(&animation->ref);
3076 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
3078 if (!refcount)
3080 d3drm_object_cleanup((IDirect3DRMObject *)&animation->IDirect3DRMAnimation_iface, &animation->obj);
3081 IDirect3DRM_Release(animation->d3drm);
3082 HeapFree(GetProcessHeap(), 0, animation);
3085 return refcount;
3088 static ULONG WINAPI d3drm_animation1_Release(IDirect3DRMAnimation *iface)
3090 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3092 return IDirect3DRMAnimation2_Release(&animation->IDirect3DRMAnimation2_iface);
3095 static HRESULT WINAPI d3drm_animation2_Clone(IDirect3DRMAnimation2 *iface, IUnknown *outer, REFIID iid, void **out)
3097 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
3099 return E_NOTIMPL;
3102 static HRESULT WINAPI d3drm_animation1_Clone(IDirect3DRMAnimation *iface, IUnknown *outer, REFIID iid, void **out)
3104 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
3106 return E_NOTIMPL;
3109 static HRESULT WINAPI d3drm_animation2_AddDestroyCallback(IDirect3DRMAnimation2 *iface,
3110 D3DRMOBJECTCALLBACK cb, void *ctx)
3112 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3114 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3116 return d3drm_object_add_destroy_callback(&animation->obj, cb, ctx);
3119 static HRESULT WINAPI d3drm_animation1_AddDestroyCallback(IDirect3DRMAnimation *iface,
3120 D3DRMOBJECTCALLBACK cb, void *ctx)
3122 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3124 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3126 return IDirect3DRMAnimation2_AddDestroyCallback(&animation->IDirect3DRMAnimation2_iface, cb, ctx);
3129 static HRESULT WINAPI d3drm_animation2_DeleteDestroyCallback(IDirect3DRMAnimation2 *iface,
3130 D3DRMOBJECTCALLBACK cb, void *ctx)
3132 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3134 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3136 return d3drm_object_delete_destroy_callback(&animation->obj, cb, ctx);
3139 static HRESULT WINAPI d3drm_animation1_DeleteDestroyCallback(IDirect3DRMAnimation *iface,
3140 D3DRMOBJECTCALLBACK cb, void *ctx)
3142 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3144 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3146 return IDirect3DRMAnimation2_DeleteDestroyCallback(&animation->IDirect3DRMAnimation2_iface, cb, ctx);
3149 static HRESULT WINAPI d3drm_animation2_SetAppData(IDirect3DRMAnimation2 *iface, DWORD data)
3151 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3153 TRACE("iface %p, data %#x.\n", iface, data);
3155 animation->obj.appdata = data;
3157 return D3DRM_OK;
3160 static HRESULT WINAPI d3drm_animation1_SetAppData(IDirect3DRMAnimation *iface, DWORD data)
3162 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3164 TRACE("iface %p, data %#x.\n", iface, data);
3166 return d3drm_animation2_SetAppData(&animation->IDirect3DRMAnimation2_iface, data);
3169 static DWORD WINAPI d3drm_animation2_GetAppData(IDirect3DRMAnimation2 *iface)
3171 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3173 TRACE("iface %p.\n", iface);
3175 return animation->obj.appdata;
3178 static DWORD WINAPI d3drm_animation1_GetAppData(IDirect3DRMAnimation *iface)
3180 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3182 TRACE("iface %p.\n", iface);
3184 return d3drm_animation2_GetAppData(&animation->IDirect3DRMAnimation2_iface);
3187 static HRESULT WINAPI d3drm_animation2_SetName(IDirect3DRMAnimation2 *iface, const char *name)
3189 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3191 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3193 return d3drm_object_set_name(&animation->obj, name);
3196 static HRESULT WINAPI d3drm_animation1_SetName(IDirect3DRMAnimation *iface, const char *name)
3198 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3200 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3202 return d3drm_animation2_SetName(&animation->IDirect3DRMAnimation2_iface, name);
3205 static HRESULT WINAPI d3drm_animation2_GetName(IDirect3DRMAnimation2 *iface, DWORD *size, char *name)
3207 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3209 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3211 return d3drm_object_get_name(&animation->obj, size, name);
3214 static HRESULT WINAPI d3drm_animation1_GetName(IDirect3DRMAnimation *iface, DWORD *size, char *name)
3216 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3218 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3220 return d3drm_animation2_GetName(&animation->IDirect3DRMAnimation2_iface, size, name);
3223 static HRESULT WINAPI d3drm_animation2_GetClassName(IDirect3DRMAnimation2 *iface, DWORD *size, char *name)
3225 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3227 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3229 return d3drm_object_get_class_name(&animation->obj, size, name);
3232 static HRESULT WINAPI d3drm_animation1_GetClassName(IDirect3DRMAnimation *iface, DWORD *size, char *name)
3234 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3236 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3238 return d3drm_animation2_GetClassName(&animation->IDirect3DRMAnimation2_iface, size, name);
3241 static HRESULT WINAPI d3drm_animation2_SetOptions(IDirect3DRMAnimation2 *iface, D3DRMANIMATIONOPTIONS options)
3243 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3244 static const DWORD supported_options = D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION
3245 | D3DRMANIMATION_SPLINEPOSITION | D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION;
3247 TRACE("iface %p, options %#x.\n", iface, options);
3249 if (!(options & supported_options))
3250 return D3DRMERR_BADVALUE;
3252 if ((options & (D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED)) == (D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED) ||
3253 (options & (D3DRMANIMATION_LINEARPOSITION | D3DRMANIMATION_SPLINEPOSITION)) ==
3254 (D3DRMANIMATION_LINEARPOSITION | D3DRMANIMATION_SPLINEPOSITION) ||
3255 (options & (D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION)) ==
3256 (D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION))
3258 return D3DRMERR_BADVALUE;
3261 animation->options = options;
3263 return D3DRM_OK;
3266 static HRESULT WINAPI d3drm_animation1_SetOptions(IDirect3DRMAnimation *iface, D3DRMANIMATIONOPTIONS options)
3268 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3270 TRACE("iface %p, %#x.\n", iface, options);
3272 return d3drm_animation2_SetOptions(&animation->IDirect3DRMAnimation2_iface, options);
3275 static HRESULT WINAPI d3drm_animation2_AddKey(IDirect3DRMAnimation2 *iface, D3DRMANIMATIONKEY *key)
3277 FIXME("iface %p, key %p.\n", iface, key);
3279 return E_NOTIMPL;
3282 static HRESULT WINAPI d3drm_animation2_AddRotateKey(IDirect3DRMAnimation2 *iface, D3DVALUE time, D3DRMQUATERNION *q)
3284 D3DRMANIMATIONKEY key;
3286 TRACE("iface %p, time %.8e, q %p.\n", iface, time, q);
3288 key.dwSize = sizeof(key);
3289 key.dwKeyType = D3DRMANIMATION_ROTATEKEY;
3290 key.dvTime = time;
3291 key.dwID = 0;
3292 key.u.dqRotateKey = *q;
3294 return d3drm_animation2_AddKey(iface, &key);
3297 static HRESULT WINAPI d3drm_animation1_AddRotateKey(IDirect3DRMAnimation *iface, D3DVALUE time, D3DRMQUATERNION *q)
3299 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3301 TRACE("iface %p, time %.8e, q %p.\n", iface, time, q);
3303 return d3drm_animation2_AddRotateKey(&animation->IDirect3DRMAnimation2_iface, time, q);
3306 static HRESULT WINAPI d3drm_animation2_AddPositionKey(IDirect3DRMAnimation2 *iface, D3DVALUE time,
3307 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3309 D3DRMANIMATIONKEY key;
3311 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3313 key.dwSize = sizeof(key);
3314 key.dwKeyType = D3DRMANIMATION_POSITIONKEY;
3315 key.dvTime = time;
3316 key.dwID = 0;
3317 key.u.dvPositionKey.u1.x = x;
3318 key.u.dvPositionKey.u2.y = y;
3319 key.u.dvPositionKey.u3.z = z;
3321 return d3drm_animation2_AddKey(iface, &key);
3324 static HRESULT WINAPI d3drm_animation1_AddPositionKey(IDirect3DRMAnimation *iface, D3DVALUE time,
3325 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3327 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3329 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3331 return d3drm_animation2_AddPositionKey(&animation->IDirect3DRMAnimation2_iface, time, x, y, z);
3334 static HRESULT WINAPI d3drm_animation2_AddScaleKey(IDirect3DRMAnimation2 *iface, D3DVALUE time,
3335 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3337 D3DRMANIMATIONKEY key;
3339 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3341 key.dwSize = sizeof(key);
3342 key.dwKeyType = D3DRMANIMATION_SCALEKEY;
3343 key.dvTime = time;
3344 key.dwID = 0;
3345 key.u.dvScaleKey.u1.x = x;
3346 key.u.dvScaleKey.u2.y = y;
3347 key.u.dvScaleKey.u3.z = z;
3349 return d3drm_animation2_AddKey(iface, &key);
3352 static HRESULT WINAPI d3drm_animation1_AddScaleKey(IDirect3DRMAnimation *iface, D3DVALUE time,
3353 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3355 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3357 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3359 return d3drm_animation2_AddScaleKey(&animation->IDirect3DRMAnimation2_iface, time, x, y, z);
3362 static HRESULT WINAPI d3drm_animation1_DeleteKey(IDirect3DRMAnimation *iface, D3DVALUE time)
3364 FIXME("iface %p, time %.8e.\n", iface, time);
3366 return E_NOTIMPL;
3369 static HRESULT WINAPI d3drm_animation1_SetFrame(IDirect3DRMAnimation *iface, IDirect3DRMFrame *frame)
3371 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3372 HRESULT hr = D3DRM_OK;
3374 TRACE("iface %p, frame %p.\n", iface, frame);
3376 if (frame)
3378 hr = IDirect3DRMFrame_QueryInterface(frame, &IID_IDirect3DRMFrame3, (void **)&animation->frame);
3379 if (SUCCEEDED(hr))
3380 IDirect3DRMFrame3_Release(animation->frame);
3382 else
3383 animation->frame = NULL;
3385 return hr;
3388 static HRESULT WINAPI d3drm_animation1_SetTime(IDirect3DRMAnimation *iface, D3DVALUE time)
3390 FIXME("iface %p, time %.8e.\n", iface, time);
3392 return E_NOTIMPL;
3395 static D3DRMANIMATIONOPTIONS WINAPI d3drm_animation2_GetOptions(IDirect3DRMAnimation2 *iface)
3397 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3399 TRACE("iface %p.\n", iface);
3401 return animation->options;
3404 static D3DRMANIMATIONOPTIONS WINAPI d3drm_animation1_GetOptions(IDirect3DRMAnimation *iface)
3406 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3408 TRACE("iface %p.\n", iface);
3410 return d3drm_animation2_GetOptions(&animation->IDirect3DRMAnimation2_iface);
3413 static HRESULT WINAPI d3drm_animation2_DeleteKey(IDirect3DRMAnimation2 *iface, D3DVALUE time)
3415 FIXME("iface %p, time %.8e.\n", iface, time);
3417 return E_NOTIMPL;
3420 static HRESULT WINAPI d3drm_animation2_SetFrame(IDirect3DRMAnimation2 *iface, IDirect3DRMFrame3 *frame)
3422 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3424 TRACE("iface %p, frame %p.\n", iface, frame);
3426 animation->frame = frame;
3428 return D3DRM_OK;
3431 static HRESULT WINAPI d3drm_animation2_SetTime(IDirect3DRMAnimation2 *iface, D3DVALUE time)
3433 FIXME("iface %p, time %.8e.\n", iface, time);
3435 return E_NOTIMPL;
3438 static HRESULT WINAPI d3drm_animation2_GetFrame(IDirect3DRMAnimation2 *iface, IDirect3DRMFrame3 **frame)
3440 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3442 TRACE("iface %p, frame %p.\n", iface, frame);
3444 if (!frame)
3445 return D3DRMERR_BADVALUE;
3447 *frame = animation->frame;
3448 if (*frame)
3449 IDirect3DRMFrame3_AddRef(*frame);
3451 return D3DRM_OK;
3454 static HRESULT WINAPI d3drm_animation2_DeleteKeyByID(IDirect3DRMAnimation2 *iface, DWORD id)
3456 FIXME("iface %p, id %#x.\n", iface, id);
3458 return E_NOTIMPL;
3461 static HRESULT WINAPI d3drm_animation2_ModifyKey(IDirect3DRMAnimation2 *iface, D3DRMANIMATIONKEY *key)
3463 FIXME("iface %p, key %p.\n", iface, key);
3465 return E_NOTIMPL;
3468 static HRESULT WINAPI d3drm_animation2_GetKeys(IDirect3DRMAnimation2 *iface, D3DVALUE time_min, D3DVALUE time_max,
3469 DWORD *key_count, D3DRMANIMATIONKEY *keys)
3471 FIXME("iface %p, time min %.e, time max %.e, count %p, keys %p.\n", iface, time_min, time_max, key_count, keys);
3473 return E_NOTIMPL;
3476 static const struct IDirect3DRMAnimationVtbl d3drm_animation1_vtbl =
3478 d3drm_animation1_QueryInterface,
3479 d3drm_animation1_AddRef,
3480 d3drm_animation1_Release,
3481 d3drm_animation1_Clone,
3482 d3drm_animation1_AddDestroyCallback,
3483 d3drm_animation1_DeleteDestroyCallback,
3484 d3drm_animation1_SetAppData,
3485 d3drm_animation1_GetAppData,
3486 d3drm_animation1_SetName,
3487 d3drm_animation1_GetName,
3488 d3drm_animation1_GetClassName,
3489 d3drm_animation1_SetOptions,
3490 d3drm_animation1_AddRotateKey,
3491 d3drm_animation1_AddPositionKey,
3492 d3drm_animation1_AddScaleKey,
3493 d3drm_animation1_DeleteKey,
3494 d3drm_animation1_SetFrame,
3495 d3drm_animation1_SetTime,
3496 d3drm_animation1_GetOptions,
3499 static const struct IDirect3DRMAnimation2Vtbl d3drm_animation2_vtbl =
3501 d3drm_animation2_QueryInterface,
3502 d3drm_animation2_AddRef,
3503 d3drm_animation2_Release,
3504 d3drm_animation2_Clone,
3505 d3drm_animation2_AddDestroyCallback,
3506 d3drm_animation2_DeleteDestroyCallback,
3507 d3drm_animation2_SetAppData,
3508 d3drm_animation2_GetAppData,
3509 d3drm_animation2_SetName,
3510 d3drm_animation2_GetName,
3511 d3drm_animation2_GetClassName,
3512 d3drm_animation2_SetOptions,
3513 d3drm_animation2_AddRotateKey,
3514 d3drm_animation2_AddPositionKey,
3515 d3drm_animation2_AddScaleKey,
3516 d3drm_animation2_DeleteKey,
3517 d3drm_animation2_SetFrame,
3518 d3drm_animation2_SetTime,
3519 d3drm_animation2_GetOptions,
3520 d3drm_animation2_GetFrame,
3521 d3drm_animation2_DeleteKeyByID,
3522 d3drm_animation2_AddKey,
3523 d3drm_animation2_ModifyKey,
3524 d3drm_animation2_GetKeys,
3527 HRESULT d3drm_animation_create(struct d3drm_animation **animation, IDirect3DRM *d3drm)
3529 static const char classname[] = "Animation";
3530 struct d3drm_animation *object;
3531 HRESULT hr = D3DRM_OK;
3533 TRACE("animation %p, d3drm %p.\n", animation, d3drm);
3535 if (!(object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*object))))
3536 return E_OUTOFMEMORY;
3538 object->IDirect3DRMAnimation_iface.lpVtbl = &d3drm_animation1_vtbl;
3539 object->IDirect3DRMAnimation2_iface.lpVtbl = &d3drm_animation2_vtbl;
3540 object->d3drm = d3drm;
3541 object->ref = 1;
3542 object->options = D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION;
3544 d3drm_object_init(&object->obj, classname);
3546 IDirect3DRM_AddRef(object->d3drm);
3548 *animation = object;
3550 return hr;