wined3d: Implement parallel point lights in process_vertices_strided().
[wine.git] / dlls / d3drm / frame.c
blob11105db40322e2b0fca8c368714826ffe73096e5
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 heap_free(array->frames);
145 heap_free(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 = heap_alloc_zero(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 = heap_calloc(frame_count, sizeof(*array->frames))))
207 heap_free(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 heap_free(array->visuals);
263 heap_free(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 = heap_alloc_zero(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 = heap_calloc(visual_count, sizeof(*array->visuals))))
325 heap_free(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 heap_free(array->lights);
382 heap_free(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 = heap_alloc_zero(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 = heap_calloc(light_count, sizeof(*array->lights))))
444 heap_free(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 heap_free(frame->children);
552 for (i = 0; i < frame->nb_visuals; ++i)
554 IDirect3DRMVisual_Release(frame->visuals[i]);
556 heap_free(frame->visuals);
557 for (i = 0; i < frame->nb_lights; ++i)
559 IDirect3DRMLight_Release(frame->lights[i]);
561 heap_free(frame->lights);
562 IDirect3DRM_Release(frame->d3drm);
563 heap_free(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 *frame = 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 (!d3drm_array_reserve((void **)&frame->children, &frame->children_size,
835 frame->nb_children + 1, sizeof(*frame->children)))
836 return E_OUTOFMEMORY;
838 frame->children[frame->nb_children++] = child;
839 IDirect3DRMFrame3_AddRef(child);
840 child_obj->parent = frame;
842 return D3DRM_OK;
845 static HRESULT WINAPI d3drm_frame2_AddChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
847 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
848 IDirect3DRMFrame3 *child3;
849 HRESULT hr;
851 TRACE("iface %p, child %p.\n", iface, child);
853 if (!child)
854 return D3DRMERR_BADOBJECT;
855 hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3);
856 if (hr != S_OK)
857 return D3DRMERR_BADOBJECT;
858 IDirect3DRMFrame_Release(child);
860 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, child3);
863 static HRESULT WINAPI d3drm_frame1_AddChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
865 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
866 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
868 TRACE("iface %p, child %p.\n", iface, child);
870 if (!child_frame)
871 return D3DRMERR_BADOBJECT;
873 return d3drm_frame3_AddChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
876 static HRESULT WINAPI d3drm_frame3_AddLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
878 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
879 ULONG i;
881 TRACE("iface %p, light %p.\n", iface, light);
883 if (!light)
884 return D3DRMERR_BADOBJECT;
886 /* Check if already existing and return gracefully without increasing ref count */
887 for (i = 0; i < frame->nb_lights; i++)
888 if (frame->lights[i] == light)
889 return D3DRM_OK;
891 if (!d3drm_array_reserve((void **)&frame->lights, &frame->lights_size,
892 frame->nb_lights + 1, sizeof(*frame->lights)))
893 return E_OUTOFMEMORY;
895 frame->lights[frame->nb_lights++] = light;
896 IDirect3DRMLight_AddRef(light);
898 return D3DRM_OK;
901 static HRESULT WINAPI d3drm_frame2_AddLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
903 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
905 TRACE("iface %p, light %p.\n", iface, light);
907 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
910 static HRESULT WINAPI d3drm_frame1_AddLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
912 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
914 TRACE("iface %p, light %p.\n", iface, light);
916 return d3drm_frame3_AddLight(&frame->IDirect3DRMFrame3_iface, light);
919 static HRESULT WINAPI d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3 *iface,
920 D3DRMFRAME3MOVECALLBACK cb, void *ctx, DWORD flags)
922 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface, cb, ctx, flags);
924 return E_NOTIMPL;
927 static HRESULT WINAPI d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2 *iface,
928 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
930 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
932 return E_NOTIMPL;
935 static HRESULT WINAPI d3drm_frame1_AddMoveCallback(IDirect3DRMFrame *iface,
936 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
938 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
940 return E_NOTIMPL;
943 static HRESULT WINAPI d3drm_frame3_AddTransform(IDirect3DRMFrame3 *iface,
944 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
946 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
948 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
950 switch (type)
952 case D3DRMCOMBINE_REPLACE:
953 memcpy(frame->transform, matrix, sizeof(D3DRMMATRIX4D));
954 break;
956 case D3DRMCOMBINE_BEFORE:
957 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
958 break;
960 case D3DRMCOMBINE_AFTER:
961 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
962 break;
964 default:
965 WARN("Unknown Combine Type %u\n", type);
966 return D3DRMERR_BADVALUE;
969 return S_OK;
972 static HRESULT WINAPI d3drm_frame2_AddTransform(IDirect3DRMFrame2 *iface,
973 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
975 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
977 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
979 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
982 static HRESULT WINAPI d3drm_frame1_AddTransform(IDirect3DRMFrame *iface,
983 D3DRMCOMBINETYPE type, D3DRMMATRIX4D matrix)
985 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
987 TRACE("iface %p, type %#x, matrix %p.\n", iface, type, matrix);
989 return d3drm_frame3_AddTransform(&frame->IDirect3DRMFrame3_iface, type, matrix);
992 static HRESULT WINAPI d3drm_frame3_AddTranslation(IDirect3DRMFrame3 *iface,
993 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
995 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
997 return E_NOTIMPL;
1000 static HRESULT WINAPI d3drm_frame2_AddTranslation(IDirect3DRMFrame2 *iface,
1001 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1003 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1005 return E_NOTIMPL;
1008 static HRESULT WINAPI d3drm_frame1_AddTranslation(IDirect3DRMFrame *iface,
1009 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z)
1011 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface, type, x, y, z);
1013 return E_NOTIMPL;
1016 static HRESULT WINAPI d3drm_frame3_AddScale(IDirect3DRMFrame3 *iface,
1017 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1019 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1021 return E_NOTIMPL;
1024 static HRESULT WINAPI d3drm_frame2_AddScale(IDirect3DRMFrame2 *iface,
1025 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1027 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1029 return E_NOTIMPL;
1032 static HRESULT WINAPI d3drm_frame1_AddScale(IDirect3DRMFrame *iface,
1033 D3DRMCOMBINETYPE type, D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1035 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface, type, sx, sy, sz);
1037 return E_NOTIMPL;
1040 static HRESULT WINAPI d3drm_frame3_AddRotation(IDirect3DRMFrame3 *iface,
1041 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1043 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1044 iface, type, x, y, z, theta);
1046 return E_NOTIMPL;
1049 static HRESULT WINAPI d3drm_frame2_AddRotation(IDirect3DRMFrame2 *iface,
1050 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1052 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1054 return E_NOTIMPL;
1057 static HRESULT WINAPI d3drm_frame1_AddRotation(IDirect3DRMFrame *iface,
1058 D3DRMCOMBINETYPE type, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
1060 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface, type, x, y, z, theta);
1062 return E_NOTIMPL;
1065 static HRESULT WINAPI d3drm_frame3_AddVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1067 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1068 ULONG i;
1070 TRACE("iface %p, visual %p.\n", iface, visual);
1072 if (!visual)
1073 return D3DRMERR_BADOBJECT;
1075 /* Check if already existing and return gracefully without increasing ref count */
1076 for (i = 0; i < frame->nb_visuals; i++)
1077 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1078 return D3DRM_OK;
1080 if (!d3drm_array_reserve((void **)&frame->visuals, &frame->visuals_size,
1081 frame->nb_visuals + 1, sizeof(*frame->visuals)))
1082 return E_OUTOFMEMORY;
1084 frame->visuals[frame->nb_visuals++] = (IDirect3DRMVisual *)visual;
1085 IDirect3DRMVisual_AddRef(visual);
1087 return D3DRM_OK;
1090 static HRESULT WINAPI d3drm_frame2_AddVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1092 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1094 TRACE("iface %p, visual %p.\n", iface, visual);
1096 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1099 static HRESULT WINAPI d3drm_frame1_AddVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1101 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1103 TRACE("iface %p, visual %p.\n", iface, visual);
1105 return d3drm_frame3_AddVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1108 static HRESULT WINAPI d3drm_frame3_GetChildren(IDirect3DRMFrame3 *iface, IDirect3DRMFrameArray **children)
1110 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1111 struct d3drm_frame_array *array;
1113 TRACE("iface %p, children %p.\n", iface, children);
1115 if (!children)
1116 return D3DRMERR_BADVALUE;
1118 if (!(array = d3drm_frame_array_create(frame->nb_children, frame->children)))
1119 return E_OUTOFMEMORY;
1121 *children = &array->IDirect3DRMFrameArray_iface;
1123 return D3DRM_OK;
1126 static HRESULT WINAPI d3drm_frame2_GetChildren(IDirect3DRMFrame2 *iface, IDirect3DRMFrameArray **children)
1128 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1130 TRACE("iface %p, children %p.\n", iface, children);
1132 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1135 static HRESULT WINAPI d3drm_frame1_GetChildren(IDirect3DRMFrame *iface, IDirect3DRMFrameArray **children)
1137 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1139 TRACE("iface %p, children %p.\n", iface, children);
1141 return d3drm_frame3_GetChildren(&frame->IDirect3DRMFrame3_iface, children);
1144 static D3DCOLOR WINAPI d3drm_frame3_GetColor(IDirect3DRMFrame3 *iface)
1146 FIXME("iface %p stub!\n", iface);
1148 return 0;
1151 static D3DCOLOR WINAPI d3drm_frame2_GetColor(IDirect3DRMFrame2 *iface)
1153 FIXME("iface %p stub!\n", iface);
1155 return 0;
1158 static D3DCOLOR WINAPI d3drm_frame1_GetColor(IDirect3DRMFrame *iface)
1160 FIXME("iface %p stub!\n", iface);
1162 return 0;
1165 static HRESULT WINAPI d3drm_frame3_GetLights(IDirect3DRMFrame3 *iface, IDirect3DRMLightArray **lights)
1167 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1168 struct d3drm_light_array *array;
1170 TRACE("iface %p, lights %p.\n", iface, lights);
1172 if (!lights)
1173 return D3DRMERR_BADVALUE;
1175 if (!(array = d3drm_light_array_create(frame->nb_lights, frame->lights)))
1176 return E_OUTOFMEMORY;
1178 *lights = &array->IDirect3DRMLightArray_iface;
1180 return D3DRM_OK;
1183 static HRESULT WINAPI d3drm_frame2_GetLights(IDirect3DRMFrame2 *iface, IDirect3DRMLightArray **lights)
1185 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1187 TRACE("iface %p, lights %p.\n", iface, lights);
1189 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1192 static HRESULT WINAPI d3drm_frame1_GetLights(IDirect3DRMFrame *iface, IDirect3DRMLightArray **lights)
1194 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1196 TRACE("iface %p, lights %p.\n", iface, lights);
1198 return d3drm_frame3_GetLights(&frame->IDirect3DRMFrame3_iface, lights);
1201 static D3DRMMATERIALMODE WINAPI d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3 *iface)
1203 FIXME("iface %p stub!\n", iface);
1205 return D3DRMMATERIAL_FROMPARENT;
1208 static D3DRMMATERIALMODE WINAPI d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2 *iface)
1210 FIXME("iface %p stub!\n", iface);
1212 return D3DRMMATERIAL_FROMPARENT;
1215 static D3DRMMATERIALMODE WINAPI d3drm_frame1_GetMaterialMode(IDirect3DRMFrame *iface)
1217 FIXME("iface %p stub!\n", iface);
1219 return D3DRMMATERIAL_FROMPARENT;
1222 static HRESULT WINAPI d3drm_frame3_GetParent(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **parent)
1224 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1226 TRACE("iface %p, parent %p.\n", iface, parent);
1228 if (!parent)
1229 return D3DRMERR_BADVALUE;
1231 if (frame->parent)
1233 *parent = &frame->parent->IDirect3DRMFrame3_iface;
1234 IDirect3DRMFrame_AddRef(*parent);
1236 else
1238 *parent = NULL;
1241 return D3DRM_OK;
1244 static HRESULT WINAPI d3drm_frame2_GetParent(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **parent)
1246 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1248 TRACE("iface %p, parent %p.\n", iface, parent);
1250 if (!parent)
1251 return D3DRMERR_BADVALUE;
1253 if (frame->parent)
1255 *parent = &frame->parent->IDirect3DRMFrame_iface;
1256 IDirect3DRMFrame_AddRef(*parent);
1258 else
1260 *parent = NULL;
1263 return D3DRM_OK;
1266 static HRESULT WINAPI d3drm_frame1_GetParent(IDirect3DRMFrame *iface, IDirect3DRMFrame **parent)
1268 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1270 TRACE("iface %p, parent %p.\n", iface, parent);
1272 return d3drm_frame2_GetParent(&frame->IDirect3DRMFrame2_iface, parent);
1275 static HRESULT WINAPI d3drm_frame3_GetPosition(IDirect3DRMFrame3 *iface,
1276 IDirect3DRMFrame3 *reference, D3DVECTOR *position)
1278 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1280 return E_NOTIMPL;
1283 static HRESULT WINAPI d3drm_frame2_GetPosition(IDirect3DRMFrame2 *iface,
1284 IDirect3DRMFrame *reference, D3DVECTOR *position)
1286 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1288 return E_NOTIMPL;
1291 static HRESULT WINAPI d3drm_frame1_GetPosition(IDirect3DRMFrame *iface,
1292 IDirect3DRMFrame *reference, D3DVECTOR *position)
1294 FIXME("iface %p, reference %p, position %p stub!\n", iface, reference, position);
1296 return E_NOTIMPL;
1300 static HRESULT WINAPI d3drm_frame3_GetRotation(IDirect3DRMFrame3 *iface,
1301 IDirect3DRMFrame3 *reference, D3DVECTOR *axis, D3DVALUE *theta)
1303 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1305 return E_NOTIMPL;
1308 static HRESULT WINAPI d3drm_frame2_GetRotation(IDirect3DRMFrame2 *iface,
1309 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1311 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1313 return E_NOTIMPL;
1316 static HRESULT WINAPI d3drm_frame1_GetRotation(IDirect3DRMFrame *iface,
1317 IDirect3DRMFrame *reference, D3DVECTOR *axis, D3DVALUE *theta)
1319 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface, reference, axis, theta);
1321 return E_NOTIMPL;
1324 static HRESULT WINAPI d3drm_frame3_GetScene(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 **scene)
1326 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1328 TRACE("iface %p, scene %p.\n", iface, scene);
1330 if (!scene)
1331 return D3DRMERR_BADVALUE;
1333 while (frame->parent)
1334 frame = frame->parent;
1336 *scene = &frame->IDirect3DRMFrame3_iface;
1337 IDirect3DRMFrame3_AddRef(*scene);
1339 return D3DRM_OK;
1342 static HRESULT WINAPI d3drm_frame2_GetScene(IDirect3DRMFrame2 *iface, IDirect3DRMFrame **scene)
1344 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1345 IDirect3DRMFrame3 *frame3;
1346 HRESULT hr;
1348 TRACE("iface %p, scene %p.\n", iface, scene);
1350 if (!scene)
1351 return D3DRMERR_BADVALUE;
1353 hr = IDirect3DRMFrame3_GetScene(&frame->IDirect3DRMFrame3_iface, &frame3);
1354 if (FAILED(hr) || !frame3)
1356 *scene = NULL;
1357 return hr;
1360 hr = IDirect3DRMFrame3_QueryInterface(frame3, &IID_IDirect3DRMFrame, (void **)scene);
1361 IDirect3DRMFrame3_Release(frame3);
1363 return hr;
1366 static HRESULT WINAPI d3drm_frame1_GetScene(IDirect3DRMFrame *iface, IDirect3DRMFrame **scene)
1368 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1370 TRACE("iface %p, scene %p.\n", iface, scene);
1372 return d3drm_frame2_GetScene(&frame->IDirect3DRMFrame2_iface, scene);
1375 static D3DRMSORTMODE WINAPI d3drm_frame3_GetSortMode(IDirect3DRMFrame3 *iface)
1377 FIXME("iface %p stub!\n", iface);
1379 return D3DRMSORT_FROMPARENT;
1382 static D3DRMSORTMODE WINAPI d3drm_frame2_GetSortMode(IDirect3DRMFrame2 *iface)
1384 FIXME("iface %p stub!\n", iface);
1386 return D3DRMSORT_FROMPARENT;
1389 static D3DRMSORTMODE WINAPI d3drm_frame1_GetSortMode(IDirect3DRMFrame *iface)
1391 FIXME("iface %p stub!\n", iface);
1393 return D3DRMSORT_FROMPARENT;
1396 static HRESULT WINAPI d3drm_frame3_GetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 **texture)
1398 FIXME("iface %p, texture %p stub!\n", iface, texture);
1400 return E_NOTIMPL;
1403 static HRESULT WINAPI d3drm_frame2_GetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture **texture)
1405 FIXME("iface %p, texture %p stub!\n", iface, texture);
1407 return E_NOTIMPL;
1410 static HRESULT WINAPI d3drm_frame1_GetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture **texture)
1412 FIXME("iface %p, texture %p stub!\n", iface, texture);
1414 return E_NOTIMPL;
1417 static HRESULT WINAPI d3drm_frame3_GetTransform(IDirect3DRMFrame3 *iface,
1418 IDirect3DRMFrame3 *reference, D3DRMMATRIX4D matrix)
1420 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1422 TRACE("iface %p, reference %p, matrix %p.\n", iface, reference, matrix);
1424 if (reference)
1425 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1427 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1429 return D3DRM_OK;
1432 static HRESULT WINAPI d3drm_frame2_GetTransform(IDirect3DRMFrame2 *iface, D3DRMMATRIX4D matrix)
1434 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1436 TRACE("iface %p, matrix %p.\n", iface, matrix);
1438 memcpy(matrix, frame->transform, sizeof(D3DRMMATRIX4D));
1440 return D3DRM_OK;
1443 static HRESULT WINAPI d3drm_frame1_GetTransform(IDirect3DRMFrame *iface, D3DRMMATRIX4D matrix)
1445 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1447 TRACE("iface %p, matrix %p.\n", iface, matrix);
1449 return d3drm_frame2_GetTransform(&frame->IDirect3DRMFrame2_iface, matrix);
1452 static HRESULT WINAPI d3drm_frame3_GetVelocity(IDirect3DRMFrame3 *iface,
1453 IDirect3DRMFrame3 *reference, D3DVECTOR *velocity, BOOL with_rotation)
1455 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1456 iface, reference, velocity, with_rotation);
1458 return E_NOTIMPL;
1461 static HRESULT WINAPI d3drm_frame2_GetVelocity(IDirect3DRMFrame2 *iface,
1462 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1464 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1465 iface, reference, velocity, with_rotation);
1467 return E_NOTIMPL;
1470 static HRESULT WINAPI d3drm_frame1_GetVelocity(IDirect3DRMFrame *iface,
1471 IDirect3DRMFrame *reference, D3DVECTOR *velocity, BOOL with_rotation)
1473 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1474 iface, reference, velocity, with_rotation);
1476 return E_NOTIMPL;
1479 static HRESULT WINAPI d3drm_frame3_GetOrientation(IDirect3DRMFrame3 *iface,
1480 IDirect3DRMFrame3 *reference, D3DVECTOR *dir, D3DVECTOR *up)
1482 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1484 return E_NOTIMPL;
1487 static HRESULT WINAPI d3drm_frame2_GetOrientation(IDirect3DRMFrame2 *iface,
1488 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1490 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1492 return E_NOTIMPL;
1495 static HRESULT WINAPI d3drm_frame1_GetOrientation(IDirect3DRMFrame *iface,
1496 IDirect3DRMFrame *reference, D3DVECTOR *dir, D3DVECTOR *up)
1498 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface, reference, dir, up);
1500 return E_NOTIMPL;
1503 static HRESULT WINAPI d3drm_frame3_GetVisuals(IDirect3DRMFrame3 *iface, DWORD *count, IUnknown **visuals)
1505 FIXME("iface %p, count %p, visuals %p stub!\n", iface, count, visuals);
1507 return E_NOTIMPL;
1510 static HRESULT WINAPI d3drm_frame2_GetVisuals(IDirect3DRMFrame2 *iface, IDirect3DRMVisualArray **visuals)
1512 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1513 struct d3drm_visual_array *array;
1515 TRACE("iface %p, visuals %p.\n", iface, visuals);
1517 if (!visuals)
1518 return D3DRMERR_BADVALUE;
1520 if (!(array = d3drm_visual_array_create(frame->nb_visuals, frame->visuals)))
1521 return E_OUTOFMEMORY;
1523 *visuals = &array->IDirect3DRMVisualArray_iface;
1525 return D3DRM_OK;
1528 static HRESULT WINAPI d3drm_frame1_GetVisuals(IDirect3DRMFrame *iface, IDirect3DRMVisualArray **visuals)
1530 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1532 TRACE("iface %p, visuals %p.\n", iface, visuals);
1534 return d3drm_frame2_GetVisuals(&frame->IDirect3DRMFrame2_iface, visuals);
1537 static HRESULT WINAPI d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2 *iface, BOOL *wrap_u, BOOL *wrap_v)
1539 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1541 return E_NOTIMPL;
1544 static HRESULT WINAPI d3drm_frame1_GetTextureTopology(IDirect3DRMFrame *iface, BOOL *wrap_u, BOOL *wrap_v)
1546 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface, wrap_u, wrap_v);
1548 return E_NOTIMPL;
1551 static HRESULT WINAPI d3drm_frame3_InverseTransform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
1553 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1555 return E_NOTIMPL;
1558 static HRESULT WINAPI d3drm_frame2_InverseTransform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
1560 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1562 return E_NOTIMPL;
1565 static HRESULT WINAPI d3drm_frame1_InverseTransform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
1567 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
1569 return E_NOTIMPL;
1572 static HRESULT WINAPI d3drm_frame3_Load(IDirect3DRMFrame3 *iface, void *filename,
1573 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURE3CALLBACK cb, void *ctx)
1575 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1576 iface, filename, name, flags, cb, ctx);
1578 return E_NOTIMPL;
1581 static HRESULT WINAPI d3drm_frame2_Load(IDirect3DRMFrame2 *iface, void *filename,
1582 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1584 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1585 iface, filename, name, flags, cb, ctx);
1587 return E_NOTIMPL;
1590 static HRESULT WINAPI d3drm_frame1_Load(IDirect3DRMFrame *iface, void *filename,
1591 void *name, D3DRMLOADOPTIONS flags, D3DRMLOADTEXTURECALLBACK cb, void *ctx)
1593 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1594 iface, filename, name, flags, cb, ctx);
1596 return E_NOTIMPL;
1599 static HRESULT WINAPI d3drm_frame3_LookAt(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *target,
1600 IDirect3DRMFrame3 *reference, D3DRMFRAMECONSTRAINT constraint)
1602 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1604 return E_NOTIMPL;
1607 static HRESULT WINAPI d3drm_frame2_LookAt(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *target,
1608 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1610 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1612 return E_NOTIMPL;
1615 static HRESULT WINAPI d3drm_frame1_LookAt(IDirect3DRMFrame *iface, IDirect3DRMFrame *target,
1616 IDirect3DRMFrame *reference, D3DRMFRAMECONSTRAINT constraint)
1618 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface, target, reference, constraint);
1620 return E_NOTIMPL;
1623 static HRESULT WINAPI d3drm_frame3_Move(IDirect3DRMFrame3 *iface, D3DVALUE delta)
1625 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1627 return E_NOTIMPL;
1630 static HRESULT WINAPI d3drm_frame2_Move(IDirect3DRMFrame2 *iface, D3DVALUE delta)
1632 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1634 return E_NOTIMPL;
1637 static HRESULT WINAPI d3drm_frame1_Move(IDirect3DRMFrame *iface, D3DVALUE delta)
1639 FIXME("iface %p, delta %.8e stub!\n", iface, delta);
1641 return E_NOTIMPL;
1644 static HRESULT WINAPI d3drm_frame3_DeleteChild(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *child)
1646 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1647 struct d3drm_frame *child_impl = unsafe_impl_from_IDirect3DRMFrame3(child);
1648 ULONG i;
1650 TRACE("iface %p, child %p.\n", iface, child);
1652 if (!child_impl)
1653 return D3DRMERR_BADOBJECT;
1655 /* Check if child exists */
1656 for (i = 0; i < frame->nb_children; ++i)
1658 if (frame->children[i] == child)
1659 break;
1662 if (i == frame->nb_children)
1663 return D3DRMERR_BADVALUE;
1665 memmove(frame->children + i, frame->children + i + 1, sizeof(*frame->children) * (frame->nb_children - 1 - i));
1666 IDirect3DRMFrame3_Release(child);
1667 child_impl->parent = NULL;
1668 --frame->nb_children;
1670 return D3DRM_OK;
1673 static HRESULT WINAPI d3drm_frame2_DeleteChild(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *child)
1675 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1676 IDirect3DRMFrame3 *child3;
1677 HRESULT hr;
1679 TRACE("iface %p, child %p.\n", iface, child);
1681 if (!child)
1682 return D3DRMERR_BADOBJECT;
1683 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(child, &IID_IDirect3DRMFrame3, (void **)&child3)))
1684 return D3DRMERR_BADOBJECT;
1685 IDirect3DRMFrame_Release(child);
1687 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, child3);
1690 static HRESULT WINAPI d3drm_frame1_DeleteChild(IDirect3DRMFrame *iface, IDirect3DRMFrame *child)
1692 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1693 struct d3drm_frame *child_frame = unsafe_impl_from_IDirect3DRMFrame(child);
1695 TRACE("iface %p, child %p.\n", iface, child);
1697 if (!child_frame)
1698 return D3DRMERR_BADOBJECT;
1700 return d3drm_frame3_DeleteChild(&frame->IDirect3DRMFrame3_iface, &child_frame->IDirect3DRMFrame3_iface);
1703 static HRESULT WINAPI d3drm_frame3_DeleteLight(IDirect3DRMFrame3 *iface, IDirect3DRMLight *light)
1705 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1706 ULONG i;
1708 TRACE("iface %p, light %p.\n", iface, light);
1710 if (!light)
1711 return D3DRMERR_BADOBJECT;
1713 /* Check if visual exists */
1714 for (i = 0; i < frame->nb_lights; ++i)
1716 if (frame->lights[i] == light)
1717 break;
1720 if (i == frame->nb_lights)
1721 return D3DRMERR_BADVALUE;
1723 memmove(frame->lights + i, frame->lights + i + 1, sizeof(*frame->lights) * (frame->nb_lights - 1 - i));
1724 IDirect3DRMLight_Release(light);
1725 --frame->nb_lights;
1727 return D3DRM_OK;
1730 static HRESULT WINAPI d3drm_frame2_DeleteLight(IDirect3DRMFrame2 *iface, IDirect3DRMLight *light)
1732 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1734 TRACE("iface %p, light %p.\n", iface, light);
1736 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1739 static HRESULT WINAPI d3drm_frame1_DeleteLight(IDirect3DRMFrame *iface, IDirect3DRMLight *light)
1741 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1743 TRACE("iface %p, light %p.\n", iface, light);
1745 return d3drm_frame3_DeleteLight(&frame->IDirect3DRMFrame3_iface, light);
1748 static HRESULT WINAPI d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3 *iface,
1749 D3DRMFRAME3MOVECALLBACK cb, void *ctx)
1751 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1753 return E_NOTIMPL;
1756 static HRESULT WINAPI d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2 *iface,
1757 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1759 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1761 return E_NOTIMPL;
1764 static HRESULT WINAPI d3drm_frame1_DeleteMoveCallback(IDirect3DRMFrame *iface,
1765 D3DRMFRAMEMOVECALLBACK cb, void *ctx)
1767 FIXME("iface %p, cb %p, ctx %p stub!\n", iface, cb, ctx);
1769 return E_NOTIMPL;
1772 static HRESULT WINAPI d3drm_frame3_DeleteVisual(IDirect3DRMFrame3 *iface, IUnknown *visual)
1774 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1775 ULONG i;
1777 TRACE("iface %p, visual %p.\n", iface, visual);
1779 if (!visual)
1780 return D3DRMERR_BADOBJECT;
1782 /* Check if visual exists */
1783 for (i = 0; i < frame->nb_visuals; ++i)
1785 if (frame->visuals[i] == (IDirect3DRMVisual *)visual)
1786 break;
1789 if (i == frame->nb_visuals)
1790 return D3DRMERR_BADVALUE;
1792 memmove(frame->visuals + i, frame->visuals + i + 1, sizeof(*frame->visuals) * (frame->nb_visuals - 1 - i));
1793 IDirect3DRMVisual_Release(visual);
1794 --frame->nb_visuals;
1796 return D3DRM_OK;
1799 static HRESULT WINAPI d3drm_frame2_DeleteVisual(IDirect3DRMFrame2 *iface, IDirect3DRMVisual *visual)
1801 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1803 TRACE("iface %p, visual %p.\n", iface, visual);
1805 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1808 static HRESULT WINAPI d3drm_frame1_DeleteVisual(IDirect3DRMFrame *iface, IDirect3DRMVisual *visual)
1810 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1812 TRACE("iface %p, visual %p.\n", iface, visual);
1814 return d3drm_frame3_DeleteVisual(&frame->IDirect3DRMFrame3_iface, (IUnknown *)visual);
1817 static D3DCOLOR WINAPI d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3 *iface)
1819 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1821 TRACE("iface %p.\n", iface);
1823 return frame->scenebackground;
1826 static D3DCOLOR WINAPI d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2 *iface)
1828 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1830 TRACE("iface %p.\n", iface);
1832 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1835 static D3DCOLOR WINAPI d3drm_frame1_GetSceneBackground(IDirect3DRMFrame *iface)
1837 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1839 TRACE("iface %p.\n", iface);
1841 return d3drm_frame3_GetSceneBackground(&frame->IDirect3DRMFrame3_iface);
1844 static HRESULT WINAPI d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
1845 IDirectDrawSurface **surface)
1847 FIXME("iface %p, surface %p stub!\n", iface, surface);
1849 return E_NOTIMPL;
1852 static HRESULT WINAPI d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
1853 IDirectDrawSurface **surface)
1855 FIXME("iface %p, surface %p stub!\n", iface, surface);
1857 return E_NOTIMPL;
1860 static HRESULT WINAPI d3drm_frame1_GetSceneBackgroundDepth(IDirect3DRMFrame *iface,
1861 IDirectDrawSurface **surface)
1863 FIXME("iface %p, surface %p stub!\n", iface, surface);
1865 return E_NOTIMPL;
1868 static D3DCOLOR WINAPI d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3 *iface)
1870 FIXME("iface %p stub!\n", iface);
1872 return 0;
1875 static D3DCOLOR WINAPI d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2 *iface)
1877 FIXME("iface %p stub!\n", iface);
1879 return 0;
1882 static D3DCOLOR WINAPI d3drm_frame1_GetSceneFogColor(IDirect3DRMFrame *iface)
1884 FIXME("iface %p stub!\n", iface);
1886 return 0;
1889 static BOOL WINAPI d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3 *iface)
1891 FIXME("iface %p stub!\n", iface);
1893 return FALSE;
1896 static BOOL WINAPI d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2 *iface)
1898 FIXME("iface %p stub!\n", iface);
1900 return FALSE;
1903 static BOOL WINAPI d3drm_frame1_GetSceneFogEnable(IDirect3DRMFrame *iface)
1905 FIXME("iface %p stub!\n", iface);
1907 return FALSE;
1910 static D3DRMFOGMODE WINAPI d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3 *iface)
1912 FIXME("iface %p stub!\n", iface);
1914 return D3DRMFOG_LINEAR;
1917 static D3DRMFOGMODE WINAPI d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2 *iface)
1919 FIXME("iface %p stub!\n", iface);
1921 return D3DRMFOG_LINEAR;
1924 static D3DRMFOGMODE WINAPI d3drm_frame1_GetSceneFogMode(IDirect3DRMFrame *iface)
1926 FIXME("iface %p stub!\n", iface);
1928 return D3DRMFOG_LINEAR;
1931 static HRESULT WINAPI d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3 *iface,
1932 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1934 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1936 return E_NOTIMPL;
1939 static HRESULT WINAPI d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2 *iface,
1940 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1942 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1944 return E_NOTIMPL;
1947 static HRESULT WINAPI d3drm_frame1_GetSceneFogParams(IDirect3DRMFrame *iface,
1948 D3DVALUE *start, D3DVALUE *end, D3DVALUE *density)
1950 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface, start, end, density);
1952 return E_NOTIMPL;
1955 static HRESULT WINAPI d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3 *iface, D3DCOLOR color)
1957 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1959 TRACE("iface %p, color 0x%08x.\n", iface, color);
1961 frame->scenebackground = color;
1963 return D3DRM_OK;
1966 static HRESULT WINAPI d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2 *iface, D3DCOLOR color)
1968 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
1970 TRACE("iface %p, color 0x%08x.\n", iface, color);
1972 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1975 static HRESULT WINAPI d3drm_frame1_SetSceneBackground(IDirect3DRMFrame *iface, D3DCOLOR color)
1977 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
1979 TRACE("iface %p, color 0x%08x.\n", iface, color);
1981 return d3drm_frame3_SetSceneBackground(&frame->IDirect3DRMFrame3_iface, color);
1984 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3 *iface,
1985 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1987 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
1989 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
1991 d3drm_set_color(&frame->scenebackground, red, green, blue, 1.0f);
1993 return D3DRM_OK;
1996 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2 *iface,
1997 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
1999 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame2(iface);
2001 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2003 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2006 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundRGB(IDirect3DRMFrame *iface,
2007 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2009 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame(iface);
2011 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
2013 return d3drm_frame3_SetSceneBackgroundRGB(&frame->IDirect3DRMFrame3_iface, red, green, blue);
2016 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3 *iface,
2017 IDirectDrawSurface *surface)
2019 FIXME("iface %p, surface %p stub!\n", iface, surface);
2021 return E_NOTIMPL;
2024 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2 *iface,
2025 IDirectDrawSurface *surface)
2027 FIXME("iface %p, surface %p stub!\n", iface, surface);
2029 return E_NOTIMPL;
2032 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundDepth(IDirect3DRMFrame *iface,
2033 IDirectDrawSurface *surface)
2035 FIXME("iface %p, surface %p stub!\n", iface, surface);
2037 return E_NOTIMPL;
2040 static HRESULT WINAPI d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3 *iface,
2041 IDirect3DRMTexture3 *texture)
2043 FIXME("iface %p, texture %p stub!\n", iface, texture);
2045 return E_NOTIMPL;
2048 static HRESULT WINAPI d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2 *iface,
2049 IDirect3DRMTexture *texture)
2051 FIXME("iface %p, texture %p stub!\n", iface, texture);
2053 return E_NOTIMPL;
2056 static HRESULT WINAPI d3drm_frame1_SetSceneBackgroundImage(IDirect3DRMFrame *iface,
2057 IDirect3DRMTexture *texture)
2059 FIXME("iface %p, texture %p stub!\n", iface, texture);
2061 return E_NOTIMPL;
2064 static HRESULT WINAPI d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2066 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2068 return E_NOTIMPL;
2071 static HRESULT WINAPI d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2 *iface, BOOL enable)
2073 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2075 return E_NOTIMPL;
2078 static HRESULT WINAPI d3drm_frame1_SetSceneFogEnable(IDirect3DRMFrame *iface, BOOL enable)
2080 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2082 return E_NOTIMPL;
2085 static HRESULT WINAPI d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2087 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2089 return E_NOTIMPL;
2092 static HRESULT WINAPI d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2094 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2096 return E_NOTIMPL;
2099 static HRESULT WINAPI d3drm_frame1_SetSceneFogColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2101 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2103 return E_NOTIMPL;
2106 static HRESULT WINAPI d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3 *iface, D3DRMFOGMODE mode)
2108 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2110 return E_NOTIMPL;
2113 static HRESULT WINAPI d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2 *iface, D3DRMFOGMODE mode)
2115 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2117 return E_NOTIMPL;
2120 static HRESULT WINAPI d3drm_frame1_SetSceneFogMode(IDirect3DRMFrame *iface, D3DRMFOGMODE mode)
2122 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2124 return E_NOTIMPL;
2127 static HRESULT WINAPI d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3 *iface,
2128 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2130 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2132 return E_NOTIMPL;
2135 static HRESULT WINAPI d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2 *iface,
2136 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2138 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2140 return E_NOTIMPL;
2143 static HRESULT WINAPI d3drm_frame1_SetSceneFogParams(IDirect3DRMFrame *iface,
2144 D3DVALUE start, D3DVALUE end, D3DVALUE density)
2146 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface, start, end, density);
2148 return E_NOTIMPL;
2151 static HRESULT WINAPI d3drm_frame3_SetColor(IDirect3DRMFrame3 *iface, D3DCOLOR color)
2153 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2155 return E_NOTIMPL;
2158 static HRESULT WINAPI d3drm_frame2_SetColor(IDirect3DRMFrame2 *iface, D3DCOLOR color)
2160 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2162 return E_NOTIMPL;
2165 static HRESULT WINAPI d3drm_frame1_SetColor(IDirect3DRMFrame *iface, D3DCOLOR color)
2167 FIXME("iface %p, color 0x%08x stub!\n", iface, color);
2169 return E_NOTIMPL;
2172 static HRESULT WINAPI d3drm_frame3_SetColorRGB(IDirect3DRMFrame3 *iface,
2173 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2175 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2177 return E_NOTIMPL;
2180 static HRESULT WINAPI d3drm_frame2_SetColorRGB(IDirect3DRMFrame2 *iface,
2181 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2183 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2185 return E_NOTIMPL;
2188 static HRESULT WINAPI d3drm_frame1_SetColorRGB(IDirect3DRMFrame *iface,
2189 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
2191 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface, red, green, blue);
2193 return E_NOTIMPL;
2196 static D3DRMZBUFFERMODE WINAPI d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3 *iface)
2198 FIXME("iface %p stub!\n", iface);
2200 return D3DRMZBUFFER_FROMPARENT;
2203 static D3DRMZBUFFERMODE WINAPI d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2 *iface)
2205 FIXME("iface %p stub!\n", iface);
2207 return D3DRMZBUFFER_FROMPARENT;
2210 static D3DRMZBUFFERMODE WINAPI d3drm_frame1_GetZbufferMode(IDirect3DRMFrame *iface)
2212 FIXME("iface %p stub!\n", iface);
2214 return D3DRMZBUFFER_FROMPARENT;
2217 static HRESULT WINAPI d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3 *iface, D3DRMMATERIALMODE mode)
2219 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2221 return E_NOTIMPL;
2224 static HRESULT WINAPI d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2 *iface, D3DRMMATERIALMODE mode)
2226 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2228 return E_NOTIMPL;
2231 static HRESULT WINAPI d3drm_frame1_SetMaterialMode(IDirect3DRMFrame *iface, D3DRMMATERIALMODE mode)
2233 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2235 return E_NOTIMPL;
2238 static HRESULT WINAPI d3drm_frame3_SetOrientation(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2239 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2241 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2242 iface, reference, dx, dy, dz, ux, uy, uz);
2244 return E_NOTIMPL;
2247 static HRESULT WINAPI d3drm_frame2_SetOrientation(IDirect3DRMFrame2 *iface, IDirect3DRMFrame *reference,
2248 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2250 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2251 iface, reference, dx, dy, dz, ux, uy, uz);
2253 return E_NOTIMPL;
2256 static HRESULT WINAPI d3drm_frame1_SetOrientation(IDirect3DRMFrame *iface, IDirect3DRMFrame *reference,
2257 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2259 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2260 iface, reference, dx, dy, dz, ux, uy, uz);
2262 return E_NOTIMPL;
2265 static HRESULT WINAPI d3drm_frame3_SetPosition(IDirect3DRMFrame3 *iface,
2266 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2268 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2270 return E_NOTIMPL;
2273 static HRESULT WINAPI d3drm_frame2_SetPosition(IDirect3DRMFrame2 *iface,
2274 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2276 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2278 return E_NOTIMPL;
2281 static HRESULT WINAPI d3drm_frame1_SetPosition(IDirect3DRMFrame *iface,
2282 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z)
2284 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface, reference, x, y, z);
2286 return E_NOTIMPL;
2289 static HRESULT WINAPI d3drm_frame3_SetRotation(IDirect3DRMFrame3 *iface,
2290 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2292 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2293 iface, reference, x, y, z, theta);
2295 return E_NOTIMPL;
2298 static HRESULT WINAPI d3drm_frame2_SetRotation(IDirect3DRMFrame2 *iface,
2299 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2301 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2302 iface, reference, x, y, z, theta);
2304 return E_NOTIMPL;
2307 static HRESULT WINAPI d3drm_frame1_SetRotation(IDirect3DRMFrame *iface,
2308 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, D3DVALUE theta)
2310 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
2311 iface, reference, x, y, z, theta);
2313 return E_NOTIMPL;
2316 static HRESULT WINAPI d3drm_frame3_SetSortMode(IDirect3DRMFrame3 *iface, D3DRMSORTMODE mode)
2318 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2320 return E_NOTIMPL;
2323 static HRESULT WINAPI d3drm_frame2_SetSortMode(IDirect3DRMFrame2 *iface, D3DRMSORTMODE mode)
2325 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2327 return E_NOTIMPL;
2330 static HRESULT WINAPI d3drm_frame1_SetSortMode(IDirect3DRMFrame *iface, D3DRMSORTMODE mode)
2332 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2334 return E_NOTIMPL;
2337 static HRESULT WINAPI d3drm_frame3_SetTexture(IDirect3DRMFrame3 *iface, IDirect3DRMTexture3 *texture)
2339 FIXME("iface %p, texture %p stub!\n", iface, texture);
2341 return E_NOTIMPL;
2344 static HRESULT WINAPI d3drm_frame2_SetTexture(IDirect3DRMFrame2 *iface, IDirect3DRMTexture *texture)
2346 FIXME("iface %p, texture %p stub!\n", iface, texture);
2348 return E_NOTIMPL;
2351 static HRESULT WINAPI d3drm_frame1_SetTexture(IDirect3DRMFrame *iface, IDirect3DRMTexture *texture)
2353 FIXME("iface %p, texture %p stub!\n", iface, texture);
2355 return E_NOTIMPL;
2358 static HRESULT WINAPI d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2 *iface, BOOL wrap_u, BOOL wrap_v)
2360 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2362 return E_NOTIMPL;
2365 static HRESULT WINAPI d3drm_frame1_SetTextureTopology(IDirect3DRMFrame *iface, BOOL wrap_u, BOOL wrap_v)
2367 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface, wrap_u, wrap_v);
2369 return E_NOTIMPL;
2372 static HRESULT WINAPI d3drm_frame3_SetVelocity(IDirect3DRMFrame3 *iface,
2373 IDirect3DRMFrame3 *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2375 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
2376 iface, reference, x, y, z, with_rotation);
2378 return E_NOTIMPL;
2381 static HRESULT WINAPI d3drm_frame2_SetVelocity(IDirect3DRMFrame2 *iface,
2382 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2384 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2385 iface, reference, x, y, z, with_rotation);
2387 return E_NOTIMPL;
2390 static HRESULT WINAPI d3drm_frame1_SetVelocity(IDirect3DRMFrame *iface,
2391 IDirect3DRMFrame *reference, D3DVALUE x, D3DVALUE y, D3DVALUE z, BOOL with_rotation)
2393 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
2394 iface, reference, x, y, z, with_rotation);
2396 return E_NOTIMPL;
2399 static HRESULT WINAPI d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3 *iface, D3DRMZBUFFERMODE mode)
2401 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2403 return E_NOTIMPL;
2406 static HRESULT WINAPI d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2 *iface, D3DRMZBUFFERMODE mode)
2408 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2410 return E_NOTIMPL;
2413 static HRESULT WINAPI d3drm_frame1_SetZbufferMode(IDirect3DRMFrame *iface, D3DRMZBUFFERMODE mode)
2415 FIXME("iface %p, mode %#x stub!\n", iface, mode);
2417 return E_NOTIMPL;
2420 static HRESULT WINAPI d3drm_frame3_Transform(IDirect3DRMFrame3 *iface, D3DVECTOR *d, D3DVECTOR *s)
2422 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2424 return E_NOTIMPL;
2427 static HRESULT WINAPI d3drm_frame2_Transform(IDirect3DRMFrame2 *iface, D3DVECTOR *d, D3DVECTOR *s)
2429 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2431 return E_NOTIMPL;
2434 static HRESULT WINAPI d3drm_frame1_Transform(IDirect3DRMFrame *iface, D3DVECTOR *d, D3DVECTOR *s)
2436 FIXME("iface %p, d %p, s %p stub!\n", iface, d, s);
2438 return E_NOTIMPL;
2441 static HRESULT WINAPI d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2 *iface,
2442 D3DRMFRAMEMOVECALLBACK cb, void *ctx, DWORD flags)
2444 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface, cb, ctx, flags);
2446 return E_NOTIMPL;
2449 static HRESULT WINAPI d3drm_frame3_GetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2451 FIXME("iface %p, box %p stub!\n", iface, box);
2453 return E_NOTIMPL;
2456 static HRESULT WINAPI d3drm_frame2_GetBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2458 FIXME("iface %p, box %p stub!\n", iface, box);
2460 return E_NOTIMPL;
2463 static BOOL WINAPI d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3 *iface)
2465 FIXME("iface %p stub!\n", iface);
2467 return FALSE;
2470 static BOOL WINAPI d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2 *iface)
2472 FIXME("iface %p stub!\n", iface);
2474 return FALSE;
2477 static HRESULT WINAPI d3drm_frame3_GetAxes(IDirect3DRMFrame3 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2479 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2481 return E_NOTIMPL;
2484 static HRESULT WINAPI d3drm_frame2_GetAxes(IDirect3DRMFrame2 *iface, D3DVECTOR *dir, D3DVECTOR *up)
2486 FIXME("iface %p, dir %p, up %p stub!\n", iface, dir, up);
2488 return E_NOTIMPL;
2491 static HRESULT WINAPI d3drm_frame3_GetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 **material)
2493 FIXME("iface %p, material %p stub!\n", iface, material);
2495 return E_NOTIMPL;
2498 static HRESULT WINAPI d3drm_frame2_GetMaterial(IDirect3DRMFrame2 *iface, IDirect3DRMMaterial **material)
2500 FIXME("iface %p, material %p stub!\n", iface, material);
2502 return E_NOTIMPL;
2505 static BOOL WINAPI d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3 *iface)
2507 FIXME("iface %p stub!\n", iface);
2509 return FALSE;
2512 static BOOL WINAPI d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2 *iface)
2514 FIXME("iface %p stub!\n", iface);
2516 return FALSE;
2519 static HRESULT WINAPI d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2521 FIXME("iface %p, box %p stub!\n", iface, box);
2523 return E_NOTIMPL;
2526 static HRESULT WINAPI d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2 *iface, D3DRMBOX *box)
2528 FIXME("iface %p, box %p stub!\n", iface, box);
2530 return E_NOTIMPL;
2533 static HRESULT WINAPI d3drm_frame3_SetBox(IDirect3DRMFrame3 *iface, D3DRMBOX *box)
2535 FIXME("iface %p, box %p stub!\n", iface, box);
2537 return E_NOTIMPL;
2540 static HRESULT WINAPI d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3 *iface, BOOL enable)
2542 FIXME("iface %p, enable %#x stub!\n", iface, enable);
2544 return E_NOTIMPL;
2547 static HRESULT WINAPI d3drm_frame3_SetAxes(IDirect3DRMFrame3 *iface,
2548 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2550 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2551 iface, dx, dy, dz, ux, uy, uz);
2553 return E_NOTIMPL;
2556 static HRESULT WINAPI d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3 *iface, BOOL inherit)
2558 FIXME("iface %p, inherit %#x stub!\n", iface, inherit);
2560 return E_NOTIMPL;
2563 static HRESULT WINAPI d3drm_frame3_SetMaterial(IDirect3DRMFrame3 *iface, IDirect3DRMMaterial2 *material)
2565 FIXME("iface %p, material %p stub!\n", iface, material);
2567 return E_NOTIMPL;
2570 static HRESULT WINAPI d3drm_frame3_SetQuaternion(IDirect3DRMFrame3 *iface,
2571 IDirect3DRMFrame3 *reference, D3DRMQUATERNION *q)
2573 FIXME("iface %p, reference %p, q %p stub!\n", iface, reference, q);
2575 return E_NOTIMPL;
2578 static HRESULT WINAPI d3drm_frame3_RayPick(IDirect3DRMFrame3 *iface, IDirect3DRMFrame3 *reference,
2579 D3DRMRAY *ray, DWORD flags, IDirect3DRMPicked2Array **visuals)
2581 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2582 iface, reference, ray, flags, visuals);
2584 return E_NOTIMPL;
2587 static HRESULT WINAPI d3drm_frame3_Save(IDirect3DRMFrame3 *iface,
2588 const char *filename, D3DRMXOFFORMAT format, D3DRMSAVEOPTIONS flags)
2590 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2591 iface, debugstr_a(filename), format, flags);
2593 return E_NOTIMPL;
2596 static HRESULT WINAPI d3drm_frame3_TransformVectors(IDirect3DRMFrame3 *iface,
2597 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2599 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2601 return E_NOTIMPL;
2604 static HRESULT WINAPI d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3 *iface,
2605 IDirect3DRMFrame3 *reference, DWORD num, D3DVECTOR *dst, D3DVECTOR *src)
2607 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface, reference, num, dst, src);
2609 return E_NOTIMPL;
2612 static HRESULT WINAPI d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD options)
2614 static const DWORD supported_options = D3DRMFRAME_RENDERENABLE | D3DRMFRAME_PICKENABLE;
2615 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
2617 TRACE("iface %p, options %#x.\n", iface, options);
2619 if (options & ~supported_options)
2620 return D3DRMERR_BADVALUE;
2622 frame->traversal_options = options;
2624 return D3DRM_OK;
2627 static HRESULT WINAPI d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3 *iface, DWORD *options)
2629 struct d3drm_frame *frame = impl_from_IDirect3DRMFrame3(iface);
2631 TRACE("iface %p, options %p.\n", iface, options);
2633 if (!options)
2634 return D3DRMERR_BADVALUE;
2636 *options = frame->traversal_options;
2638 return D3DRM_OK;
2641 static HRESULT WINAPI d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD flags)
2643 FIXME("iface %p, flags %#x stub!\n", iface, flags);
2645 return E_NOTIMPL;
2648 static HRESULT WINAPI d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3 *iface, DWORD *fog_mode)
2650 FIXME("iface %p, fog_mode %p stub!\n", iface, fog_mode);
2652 return E_NOTIMPL;
2655 static HRESULT WINAPI d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3 *iface,
2656 D3DRMMATERIALOVERRIDE *override)
2658 FIXME("iface %p, override %p stub!\n", iface, override);
2660 return E_NOTIMPL;
2663 static HRESULT WINAPI d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3 *iface,
2664 D3DRMMATERIALOVERRIDE *override)
2666 FIXME("iface %p, override %p stub!\n", iface, override);
2668 return E_NOTIMPL;
2671 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl =
2673 d3drm_frame3_QueryInterface,
2674 d3drm_frame3_AddRef,
2675 d3drm_frame3_Release,
2676 d3drm_frame3_Clone,
2677 d3drm_frame3_AddDestroyCallback,
2678 d3drm_frame3_DeleteDestroyCallback,
2679 d3drm_frame3_SetAppData,
2680 d3drm_frame3_GetAppData,
2681 d3drm_frame3_SetName,
2682 d3drm_frame3_GetName,
2683 d3drm_frame3_GetClassName,
2684 d3drm_frame3_AddChild,
2685 d3drm_frame3_AddLight,
2686 d3drm_frame3_AddMoveCallback,
2687 d3drm_frame3_AddTransform,
2688 d3drm_frame3_AddTranslation,
2689 d3drm_frame3_AddScale,
2690 d3drm_frame3_AddRotation,
2691 d3drm_frame3_AddVisual,
2692 d3drm_frame3_GetChildren,
2693 d3drm_frame3_GetColor,
2694 d3drm_frame3_GetLights,
2695 d3drm_frame3_GetMaterialMode,
2696 d3drm_frame3_GetParent,
2697 d3drm_frame3_GetPosition,
2698 d3drm_frame3_GetRotation,
2699 d3drm_frame3_GetScene,
2700 d3drm_frame3_GetSortMode,
2701 d3drm_frame3_GetTexture,
2702 d3drm_frame3_GetTransform,
2703 d3drm_frame3_GetVelocity,
2704 d3drm_frame3_GetOrientation,
2705 d3drm_frame3_GetVisuals,
2706 d3drm_frame3_InverseTransform,
2707 d3drm_frame3_Load,
2708 d3drm_frame3_LookAt,
2709 d3drm_frame3_Move,
2710 d3drm_frame3_DeleteChild,
2711 d3drm_frame3_DeleteLight,
2712 d3drm_frame3_DeleteMoveCallback,
2713 d3drm_frame3_DeleteVisual,
2714 d3drm_frame3_GetSceneBackground,
2715 d3drm_frame3_GetSceneBackgroundDepth,
2716 d3drm_frame3_GetSceneFogColor,
2717 d3drm_frame3_GetSceneFogEnable,
2718 d3drm_frame3_GetSceneFogMode,
2719 d3drm_frame3_GetSceneFogParams,
2720 d3drm_frame3_SetSceneBackground,
2721 d3drm_frame3_SetSceneBackgroundRGB,
2722 d3drm_frame3_SetSceneBackgroundDepth,
2723 d3drm_frame3_SetSceneBackgroundImage,
2724 d3drm_frame3_SetSceneFogEnable,
2725 d3drm_frame3_SetSceneFogColor,
2726 d3drm_frame3_SetSceneFogMode,
2727 d3drm_frame3_SetSceneFogParams,
2728 d3drm_frame3_SetColor,
2729 d3drm_frame3_SetColorRGB,
2730 d3drm_frame3_GetZbufferMode,
2731 d3drm_frame3_SetMaterialMode,
2732 d3drm_frame3_SetOrientation,
2733 d3drm_frame3_SetPosition,
2734 d3drm_frame3_SetRotation,
2735 d3drm_frame3_SetSortMode,
2736 d3drm_frame3_SetTexture,
2737 d3drm_frame3_SetVelocity,
2738 d3drm_frame3_SetZbufferMode,
2739 d3drm_frame3_Transform,
2740 d3drm_frame3_GetBox,
2741 d3drm_frame3_GetBoxEnable,
2742 d3drm_frame3_GetAxes,
2743 d3drm_frame3_GetMaterial,
2744 d3drm_frame3_GetInheritAxes,
2745 d3drm_frame3_GetHierarchyBox,
2746 d3drm_frame3_SetBox,
2747 d3drm_frame3_SetBoxEnable,
2748 d3drm_frame3_SetAxes,
2749 d3drm_frame3_SetInheritAxes,
2750 d3drm_frame3_SetMaterial,
2751 d3drm_frame3_SetQuaternion,
2752 d3drm_frame3_RayPick,
2753 d3drm_frame3_Save,
2754 d3drm_frame3_TransformVectors,
2755 d3drm_frame3_InverseTransformVectors,
2756 d3drm_frame3_SetTraversalOptions,
2757 d3drm_frame3_GetTraversalOptions,
2758 d3drm_frame3_SetSceneFogMethod,
2759 d3drm_frame3_GetSceneFogMethod,
2760 d3drm_frame3_SetMaterialOverride,
2761 d3drm_frame3_GetMaterialOverride,
2764 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl =
2766 d3drm_frame2_QueryInterface,
2767 d3drm_frame2_AddRef,
2768 d3drm_frame2_Release,
2769 d3drm_frame2_Clone,
2770 d3drm_frame2_AddDestroyCallback,
2771 d3drm_frame2_DeleteDestroyCallback,
2772 d3drm_frame2_SetAppData,
2773 d3drm_frame2_GetAppData,
2774 d3drm_frame2_SetName,
2775 d3drm_frame2_GetName,
2776 d3drm_frame2_GetClassName,
2777 d3drm_frame2_AddChild,
2778 d3drm_frame2_AddLight,
2779 d3drm_frame2_AddMoveCallback,
2780 d3drm_frame2_AddTransform,
2781 d3drm_frame2_AddTranslation,
2782 d3drm_frame2_AddScale,
2783 d3drm_frame2_AddRotation,
2784 d3drm_frame2_AddVisual,
2785 d3drm_frame2_GetChildren,
2786 d3drm_frame2_GetColor,
2787 d3drm_frame2_GetLights,
2788 d3drm_frame2_GetMaterialMode,
2789 d3drm_frame2_GetParent,
2790 d3drm_frame2_GetPosition,
2791 d3drm_frame2_GetRotation,
2792 d3drm_frame2_GetScene,
2793 d3drm_frame2_GetSortMode,
2794 d3drm_frame2_GetTexture,
2795 d3drm_frame2_GetTransform,
2796 d3drm_frame2_GetVelocity,
2797 d3drm_frame2_GetOrientation,
2798 d3drm_frame2_GetVisuals,
2799 d3drm_frame2_GetTextureTopology,
2800 d3drm_frame2_InverseTransform,
2801 d3drm_frame2_Load,
2802 d3drm_frame2_LookAt,
2803 d3drm_frame2_Move,
2804 d3drm_frame2_DeleteChild,
2805 d3drm_frame2_DeleteLight,
2806 d3drm_frame2_DeleteMoveCallback,
2807 d3drm_frame2_DeleteVisual,
2808 d3drm_frame2_GetSceneBackground,
2809 d3drm_frame2_GetSceneBackgroundDepth,
2810 d3drm_frame2_GetSceneFogColor,
2811 d3drm_frame2_GetSceneFogEnable,
2812 d3drm_frame2_GetSceneFogMode,
2813 d3drm_frame2_GetSceneFogParams,
2814 d3drm_frame2_SetSceneBackground,
2815 d3drm_frame2_SetSceneBackgroundRGB,
2816 d3drm_frame2_SetSceneBackgroundDepth,
2817 d3drm_frame2_SetSceneBackgroundImage,
2818 d3drm_frame2_SetSceneFogEnable,
2819 d3drm_frame2_SetSceneFogColor,
2820 d3drm_frame2_SetSceneFogMode,
2821 d3drm_frame2_SetSceneFogParams,
2822 d3drm_frame2_SetColor,
2823 d3drm_frame2_SetColorRGB,
2824 d3drm_frame2_GetZbufferMode,
2825 d3drm_frame2_SetMaterialMode,
2826 d3drm_frame2_SetOrientation,
2827 d3drm_frame2_SetPosition,
2828 d3drm_frame2_SetRotation,
2829 d3drm_frame2_SetSortMode,
2830 d3drm_frame2_SetTexture,
2831 d3drm_frame2_SetTextureTopology,
2832 d3drm_frame2_SetVelocity,
2833 d3drm_frame2_SetZbufferMode,
2834 d3drm_frame2_Transform,
2835 d3drm_frame2_AddMoveCallback2,
2836 d3drm_frame2_GetBox,
2837 d3drm_frame2_GetBoxEnable,
2838 d3drm_frame2_GetAxes,
2839 d3drm_frame2_GetMaterial,
2840 d3drm_frame2_GetInheritAxes,
2841 d3drm_frame2_GetHierarchyBox,
2844 static const struct IDirect3DRMFrameVtbl d3drm_frame1_vtbl =
2846 d3drm_frame1_QueryInterface,
2847 d3drm_frame1_AddRef,
2848 d3drm_frame1_Release,
2849 d3drm_frame1_Clone,
2850 d3drm_frame1_AddDestroyCallback,
2851 d3drm_frame1_DeleteDestroyCallback,
2852 d3drm_frame1_SetAppData,
2853 d3drm_frame1_GetAppData,
2854 d3drm_frame1_SetName,
2855 d3drm_frame1_GetName,
2856 d3drm_frame1_GetClassName,
2857 d3drm_frame1_AddChild,
2858 d3drm_frame1_AddLight,
2859 d3drm_frame1_AddMoveCallback,
2860 d3drm_frame1_AddTransform,
2861 d3drm_frame1_AddTranslation,
2862 d3drm_frame1_AddScale,
2863 d3drm_frame1_AddRotation,
2864 d3drm_frame1_AddVisual,
2865 d3drm_frame1_GetChildren,
2866 d3drm_frame1_GetColor,
2867 d3drm_frame1_GetLights,
2868 d3drm_frame1_GetMaterialMode,
2869 d3drm_frame1_GetParent,
2870 d3drm_frame1_GetPosition,
2871 d3drm_frame1_GetRotation,
2872 d3drm_frame1_GetScene,
2873 d3drm_frame1_GetSortMode,
2874 d3drm_frame1_GetTexture,
2875 d3drm_frame1_GetTransform,
2876 d3drm_frame1_GetVelocity,
2877 d3drm_frame1_GetOrientation,
2878 d3drm_frame1_GetVisuals,
2879 d3drm_frame1_GetTextureTopology,
2880 d3drm_frame1_InverseTransform,
2881 d3drm_frame1_Load,
2882 d3drm_frame1_LookAt,
2883 d3drm_frame1_Move,
2884 d3drm_frame1_DeleteChild,
2885 d3drm_frame1_DeleteLight,
2886 d3drm_frame1_DeleteMoveCallback,
2887 d3drm_frame1_DeleteVisual,
2888 d3drm_frame1_GetSceneBackground,
2889 d3drm_frame1_GetSceneBackgroundDepth,
2890 d3drm_frame1_GetSceneFogColor,
2891 d3drm_frame1_GetSceneFogEnable,
2892 d3drm_frame1_GetSceneFogMode,
2893 d3drm_frame1_GetSceneFogParams,
2894 d3drm_frame1_SetSceneBackground,
2895 d3drm_frame1_SetSceneBackgroundRGB,
2896 d3drm_frame1_SetSceneBackgroundDepth,
2897 d3drm_frame1_SetSceneBackgroundImage,
2898 d3drm_frame1_SetSceneFogEnable,
2899 d3drm_frame1_SetSceneFogColor,
2900 d3drm_frame1_SetSceneFogMode,
2901 d3drm_frame1_SetSceneFogParams,
2902 d3drm_frame1_SetColor,
2903 d3drm_frame1_SetColorRGB,
2904 d3drm_frame1_GetZbufferMode,
2905 d3drm_frame1_SetMaterialMode,
2906 d3drm_frame1_SetOrientation,
2907 d3drm_frame1_SetPosition,
2908 d3drm_frame1_SetRotation,
2909 d3drm_frame1_SetSortMode,
2910 d3drm_frame1_SetTexture,
2911 d3drm_frame1_SetTextureTopology,
2912 d3drm_frame1_SetVelocity,
2913 d3drm_frame1_SetZbufferMode,
2914 d3drm_frame1_Transform,
2917 static inline struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2919 if (!iface)
2920 return NULL;
2921 assert(iface->lpVtbl == &d3drm_frame3_vtbl);
2923 return impl_from_IDirect3DRMFrame3(iface);
2926 struct d3drm_frame *unsafe_impl_from_IDirect3DRMFrame(IDirect3DRMFrame *iface)
2928 if (!iface)
2929 return NULL;
2930 assert(iface->lpVtbl == &d3drm_frame1_vtbl);
2932 return impl_from_IDirect3DRMFrame(iface);
2935 HRESULT d3drm_frame_create(struct d3drm_frame **frame, IUnknown *parent_frame, IDirect3DRM *d3drm)
2937 static const char classname[] = "Frame";
2938 struct d3drm_frame *object;
2939 HRESULT hr = D3DRM_OK;
2941 TRACE("frame %p, parent_frame %p, d3drm %p.\n", frame, parent_frame, d3drm);
2943 if (!(object = heap_alloc_zero(sizeof(*object))))
2944 return E_OUTOFMEMORY;
2946 object->IDirect3DRMFrame_iface.lpVtbl = &d3drm_frame1_vtbl;
2947 object->IDirect3DRMFrame2_iface.lpVtbl = &d3drm_frame2_vtbl;
2948 object->IDirect3DRMFrame3_iface.lpVtbl = &d3drm_frame3_vtbl;
2949 object->d3drm = d3drm;
2950 object->ref = 1;
2951 d3drm_set_color(&object->scenebackground, 0.0f, 0.0f, 0.0f, 1.0f);
2952 object->traversal_options = D3DRMFRAME_RENDERENABLE | D3DRMFRAME_PICKENABLE;
2954 d3drm_object_init(&object->obj, classname);
2956 memcpy(object->transform, identity, sizeof(D3DRMMATRIX4D));
2958 if (parent_frame)
2960 IDirect3DRMFrame3 *p;
2962 if (FAILED(hr = IDirect3DRMFrame_QueryInterface(parent_frame, &IID_IDirect3DRMFrame3, (void **)&p)))
2964 heap_free(object);
2965 return hr;
2967 IDirect3DRMFrame_Release(parent_frame);
2968 IDirect3DRMFrame3_AddChild(p, &object->IDirect3DRMFrame3_iface);
2971 IDirect3DRM_AddRef(object->d3drm);
2973 *frame = object;
2975 return hr;
2978 static HRESULT WINAPI d3drm_animation2_QueryInterface(IDirect3DRMAnimation2 *iface, REFIID riid, void **out)
2980 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
2982 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
2984 if (IsEqualGUID(riid, &IID_IDirect3DRMAnimation)
2985 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
2986 || IsEqualGUID(riid, &IID_IUnknown))
2988 *out = &animation->IDirect3DRMAnimation_iface;
2990 else if (IsEqualGUID(riid, &IID_IDirect3DRMAnimation2))
2992 *out = &animation->IDirect3DRMAnimation2_iface;
2994 else
2996 *out = NULL;
2997 WARN("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(riid));
2998 return CLASS_E_CLASSNOTAVAILABLE;
3001 IUnknown_AddRef((IUnknown *)*out);
3002 return S_OK;
3005 static HRESULT WINAPI d3drm_animation1_QueryInterface(IDirect3DRMAnimation *iface, REFIID riid, void **out)
3007 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3009 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
3011 return IDirect3DRMAnimation2_QueryInterface(&animation->IDirect3DRMAnimation2_iface, riid, out);
3014 static ULONG WINAPI d3drm_animation2_AddRef(IDirect3DRMAnimation2 *iface)
3016 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3017 ULONG refcount = InterlockedIncrement(&animation->ref);
3019 TRACE("%p increasing refcount to %u.\n", iface, refcount);
3021 return refcount;
3024 static ULONG WINAPI d3drm_animation1_AddRef(IDirect3DRMAnimation *iface)
3026 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3027 return IDirect3DRMAnimation2_AddRef(&animation->IDirect3DRMAnimation2_iface);
3030 static ULONG WINAPI d3drm_animation2_Release(IDirect3DRMAnimation2 *iface)
3032 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3033 ULONG refcount = InterlockedDecrement(&animation->ref);
3035 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
3037 if (!refcount)
3039 d3drm_object_cleanup((IDirect3DRMObject *)&animation->IDirect3DRMAnimation_iface, &animation->obj);
3040 IDirect3DRM_Release(animation->d3drm);
3041 heap_free(animation->rotate.keys);
3042 heap_free(animation->scale.keys);
3043 heap_free(animation->position.keys);
3044 heap_free(animation);
3047 return refcount;
3050 static ULONG WINAPI d3drm_animation1_Release(IDirect3DRMAnimation *iface)
3052 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3054 return IDirect3DRMAnimation2_Release(&animation->IDirect3DRMAnimation2_iface);
3057 static HRESULT WINAPI d3drm_animation2_Clone(IDirect3DRMAnimation2 *iface, IUnknown *outer, REFIID iid, void **out)
3059 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
3061 return E_NOTIMPL;
3064 static HRESULT WINAPI d3drm_animation1_Clone(IDirect3DRMAnimation *iface, IUnknown *outer, REFIID iid, void **out)
3066 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
3068 return E_NOTIMPL;
3071 static HRESULT WINAPI d3drm_animation2_AddDestroyCallback(IDirect3DRMAnimation2 *iface,
3072 D3DRMOBJECTCALLBACK cb, void *ctx)
3074 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3076 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3078 return d3drm_object_add_destroy_callback(&animation->obj, cb, ctx);
3081 static HRESULT WINAPI d3drm_animation1_AddDestroyCallback(IDirect3DRMAnimation *iface,
3082 D3DRMOBJECTCALLBACK cb, void *ctx)
3084 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3086 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3088 return IDirect3DRMAnimation2_AddDestroyCallback(&animation->IDirect3DRMAnimation2_iface, cb, ctx);
3091 static HRESULT WINAPI d3drm_animation2_DeleteDestroyCallback(IDirect3DRMAnimation2 *iface,
3092 D3DRMOBJECTCALLBACK cb, void *ctx)
3094 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3096 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3098 return d3drm_object_delete_destroy_callback(&animation->obj, cb, ctx);
3101 static HRESULT WINAPI d3drm_animation1_DeleteDestroyCallback(IDirect3DRMAnimation *iface,
3102 D3DRMOBJECTCALLBACK cb, void *ctx)
3104 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3106 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
3108 return IDirect3DRMAnimation2_DeleteDestroyCallback(&animation->IDirect3DRMAnimation2_iface, cb, ctx);
3111 static HRESULT WINAPI d3drm_animation2_SetAppData(IDirect3DRMAnimation2 *iface, DWORD data)
3113 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3115 TRACE("iface %p, data %#x.\n", iface, data);
3117 animation->obj.appdata = data;
3119 return D3DRM_OK;
3122 static HRESULT WINAPI d3drm_animation1_SetAppData(IDirect3DRMAnimation *iface, DWORD data)
3124 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3126 TRACE("iface %p, data %#x.\n", iface, data);
3128 return d3drm_animation2_SetAppData(&animation->IDirect3DRMAnimation2_iface, data);
3131 static DWORD WINAPI d3drm_animation2_GetAppData(IDirect3DRMAnimation2 *iface)
3133 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3135 TRACE("iface %p.\n", iface);
3137 return animation->obj.appdata;
3140 static DWORD WINAPI d3drm_animation1_GetAppData(IDirect3DRMAnimation *iface)
3142 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3144 TRACE("iface %p.\n", iface);
3146 return d3drm_animation2_GetAppData(&animation->IDirect3DRMAnimation2_iface);
3149 static HRESULT WINAPI d3drm_animation2_SetName(IDirect3DRMAnimation2 *iface, const char *name)
3151 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3153 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3155 return d3drm_object_set_name(&animation->obj, name);
3158 static HRESULT WINAPI d3drm_animation1_SetName(IDirect3DRMAnimation *iface, const char *name)
3160 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3162 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
3164 return d3drm_animation2_SetName(&animation->IDirect3DRMAnimation2_iface, name);
3167 static HRESULT WINAPI d3drm_animation2_GetName(IDirect3DRMAnimation2 *iface, DWORD *size, char *name)
3169 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3171 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3173 return d3drm_object_get_name(&animation->obj, size, name);
3176 static HRESULT WINAPI d3drm_animation1_GetName(IDirect3DRMAnimation *iface, DWORD *size, char *name)
3178 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3180 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3182 return d3drm_animation2_GetName(&animation->IDirect3DRMAnimation2_iface, size, name);
3185 static HRESULT WINAPI d3drm_animation2_GetClassName(IDirect3DRMAnimation2 *iface, DWORD *size, char *name)
3187 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3189 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3191 return d3drm_object_get_class_name(&animation->obj, size, name);
3194 static HRESULT WINAPI d3drm_animation1_GetClassName(IDirect3DRMAnimation *iface, DWORD *size, char *name)
3196 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3198 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
3200 return d3drm_animation2_GetClassName(&animation->IDirect3DRMAnimation2_iface, size, name);
3203 static HRESULT WINAPI d3drm_animation2_SetOptions(IDirect3DRMAnimation2 *iface, D3DRMANIMATIONOPTIONS options)
3205 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3206 static const DWORD supported_options = D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION
3207 | D3DRMANIMATION_SPLINEPOSITION | D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION;
3209 TRACE("iface %p, options %#x.\n", iface, options);
3211 if (!(options & supported_options))
3212 return D3DRMERR_BADVALUE;
3214 if ((options & (D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED)) == (D3DRMANIMATION_OPEN | D3DRMANIMATION_CLOSED) ||
3215 (options & (D3DRMANIMATION_LINEARPOSITION | D3DRMANIMATION_SPLINEPOSITION)) ==
3216 (D3DRMANIMATION_LINEARPOSITION | D3DRMANIMATION_SPLINEPOSITION) ||
3217 (options & (D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION)) ==
3218 (D3DRMANIMATION_SCALEANDROTATION | D3DRMANIMATION_POSITION))
3220 return D3DRMERR_BADVALUE;
3223 animation->options = options;
3225 return D3DRM_OK;
3228 static HRESULT WINAPI d3drm_animation1_SetOptions(IDirect3DRMAnimation *iface, D3DRMANIMATIONOPTIONS options)
3230 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3232 TRACE("iface %p, %#x.\n", iface, options);
3234 return d3drm_animation2_SetOptions(&animation->IDirect3DRMAnimation2_iface, options);
3237 static SIZE_T d3drm_animation_lookup_key(const struct d3drm_animation_key *keys,
3238 SIZE_T count, D3DVALUE time)
3240 SIZE_T start = 0, cur = 0, end = count;
3242 while (start < end)
3244 cur = start + (end - start) / 2;
3246 if (time == keys[cur].time)
3247 return cur;
3249 if (time < keys[cur].time)
3250 end = cur;
3251 else
3252 start = cur + 1;
3255 return cur;
3258 static SIZE_T d3drm_animation_get_index_min(const struct d3drm_animation_key *keys, SIZE_T count, D3DVALUE time)
3260 SIZE_T i;
3262 i = d3drm_animation_lookup_key(keys, count, time);
3263 while (i > 0 && keys[i - 1].time == time)
3264 --i;
3266 return i;
3269 static SIZE_T d3drm_animation_get_index_max(const struct d3drm_animation_key *keys, SIZE_T count, D3DVALUE time)
3271 SIZE_T i;
3273 i = d3drm_animation_lookup_key(keys, count, time);
3274 while (i < count - 1 && keys[i + 1].time == time)
3275 ++i;
3277 return i;
3280 static SIZE_T d3drm_animation_get_insert_position(const struct d3drm_animation_keys *keys, D3DVALUE time)
3282 if (!keys->count || time < keys->keys[0].time)
3283 return 0;
3285 if (time >= keys->keys[keys->count - 1].time)
3286 return keys->count;
3288 return d3drm_animation_get_index_max(keys->keys, keys->count, time);
3291 static const struct d3drm_animation_key *d3drm_animation_get_range(const struct d3drm_animation_keys *keys,
3292 D3DVALUE time_min, D3DVALUE time_max, SIZE_T *count)
3294 SIZE_T min;
3296 if (!keys->count || time_max < keys->keys[0].time
3297 || time_min > keys->keys[keys->count - 1].time)
3298 return NULL;
3300 min = d3drm_animation_get_index_min(keys->keys, keys->count, time_min);
3301 if (count)
3302 *count = d3drm_animation_get_index_max(&keys->keys[min], keys->count - min, time_max) - min + 1;
3304 return &keys->keys[min];
3307 static HRESULT WINAPI d3drm_animation2_AddKey(IDirect3DRMAnimation2 *iface, D3DRMANIMATIONKEY *key)
3309 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3310 struct d3drm_animation_keys *keys;
3311 SIZE_T index;
3313 TRACE("iface %p, key %p.\n", iface, key);
3315 if (!key || key->dwSize != sizeof(*key))
3316 return E_INVALIDARG;
3318 switch (key->dwKeyType)
3320 case D3DRMANIMATION_POSITIONKEY:
3321 keys = &animation->position;
3322 break;
3323 case D3DRMANIMATION_SCALEKEY:
3324 keys = &animation->scale;
3325 break;
3326 case D3DRMANIMATION_ROTATEKEY:
3327 keys = &animation->rotate;
3328 break;
3329 default:
3330 return E_INVALIDARG;
3333 index = d3drm_animation_get_insert_position(keys, key->dvTime);
3335 if (!d3drm_array_reserve((void **)&keys->keys, &keys->size, keys->count + 1, sizeof(*keys->keys)))
3336 return E_OUTOFMEMORY;
3338 if (index < keys->count)
3339 memmove(&keys->keys[index + 1], &keys->keys[index], sizeof(*keys->keys) * (keys->count - index));
3340 keys->keys[index].time = key->dvTime;
3341 switch (key->dwKeyType)
3343 case D3DRMANIMATION_POSITIONKEY:
3344 keys->keys[index].u.position = key->u.dvPositionKey;
3345 break;
3346 case D3DRMANIMATION_SCALEKEY:
3347 keys->keys[index].u.scale = key->u.dvScaleKey;
3348 break;
3349 case D3DRMANIMATION_ROTATEKEY:
3350 keys->keys[index].u.rotate = key->u.dqRotateKey;
3351 break;
3353 ++keys->count;
3355 return D3DRM_OK;
3358 static HRESULT WINAPI d3drm_animation2_AddRotateKey(IDirect3DRMAnimation2 *iface, D3DVALUE time, D3DRMQUATERNION *q)
3360 D3DRMANIMATIONKEY key;
3362 TRACE("iface %p, time %.8e, q %p.\n", iface, time, q);
3364 key.dwSize = sizeof(key);
3365 key.dwKeyType = D3DRMANIMATION_ROTATEKEY;
3366 key.dvTime = time;
3367 key.dwID = 0;
3368 key.u.dqRotateKey = *q;
3370 return d3drm_animation2_AddKey(iface, &key);
3373 static HRESULT WINAPI d3drm_animation1_AddRotateKey(IDirect3DRMAnimation *iface, D3DVALUE time, D3DRMQUATERNION *q)
3375 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3377 TRACE("iface %p, time %.8e, q %p.\n", iface, time, q);
3379 return d3drm_animation2_AddRotateKey(&animation->IDirect3DRMAnimation2_iface, time, q);
3382 static HRESULT WINAPI d3drm_animation2_AddPositionKey(IDirect3DRMAnimation2 *iface, D3DVALUE time,
3383 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3385 D3DRMANIMATIONKEY key;
3387 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3389 key.dwSize = sizeof(key);
3390 key.dwKeyType = D3DRMANIMATION_POSITIONKEY;
3391 key.dvTime = time;
3392 key.dwID = 0;
3393 key.u.dvPositionKey.u1.x = x;
3394 key.u.dvPositionKey.u2.y = y;
3395 key.u.dvPositionKey.u3.z = z;
3397 return d3drm_animation2_AddKey(iface, &key);
3400 static HRESULT WINAPI d3drm_animation1_AddPositionKey(IDirect3DRMAnimation *iface, D3DVALUE time,
3401 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3403 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3405 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3407 return d3drm_animation2_AddPositionKey(&animation->IDirect3DRMAnimation2_iface, time, x, y, z);
3410 static HRESULT WINAPI d3drm_animation2_AddScaleKey(IDirect3DRMAnimation2 *iface, D3DVALUE time,
3411 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3413 D3DRMANIMATIONKEY key;
3415 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3417 key.dwSize = sizeof(key);
3418 key.dwKeyType = D3DRMANIMATION_SCALEKEY;
3419 key.dvTime = time;
3420 key.dwID = 0;
3421 key.u.dvScaleKey.u1.x = x;
3422 key.u.dvScaleKey.u2.y = y;
3423 key.u.dvScaleKey.u3.z = z;
3425 return d3drm_animation2_AddKey(iface, &key);
3428 static HRESULT WINAPI d3drm_animation1_AddScaleKey(IDirect3DRMAnimation *iface, D3DVALUE time,
3429 D3DVALUE x, D3DVALUE y, D3DVALUE z)
3431 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3433 TRACE("iface %p, time %.8e, x %.8e, y %.8e, z %.8e.\n", iface, time, x, y, z);
3435 return d3drm_animation2_AddScaleKey(&animation->IDirect3DRMAnimation2_iface, time, x, y, z);
3438 static void d3drm_animation_delete_key(struct d3drm_animation_keys *keys, const struct d3drm_animation_key *key)
3440 SIZE_T index = key - keys->keys;
3442 if (index < keys->count - 1)
3443 memmove(&keys->keys[index], &keys->keys[index + 1], sizeof(*keys->keys) * (keys->count - index - 1));
3444 --keys->count;
3447 static HRESULT WINAPI d3drm_animation2_DeleteKey(IDirect3DRMAnimation2 *iface, D3DVALUE time)
3449 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3450 const struct d3drm_animation_key *key;
3452 TRACE("iface %p, time %.8e.\n", iface, time);
3454 if ((key = d3drm_animation_get_range(&animation->rotate, time, time, NULL)))
3455 d3drm_animation_delete_key(&animation->rotate, key);
3457 if ((key = d3drm_animation_get_range(&animation->position, time, time, NULL)))
3458 d3drm_animation_delete_key(&animation->position, key);
3460 if ((key = d3drm_animation_get_range(&animation->scale, time, time, NULL)))
3461 d3drm_animation_delete_key(&animation->scale, key);
3463 return D3DRM_OK;
3466 static HRESULT WINAPI d3drm_animation1_DeleteKey(IDirect3DRMAnimation *iface, D3DVALUE time)
3468 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3470 TRACE("iface %p, time %.8e.\n", iface, time);
3472 return d3drm_animation2_DeleteKey(&animation->IDirect3DRMAnimation2_iface, time);
3475 static HRESULT WINAPI d3drm_animation1_SetFrame(IDirect3DRMAnimation *iface, IDirect3DRMFrame *frame)
3477 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3478 HRESULT hr = D3DRM_OK;
3480 TRACE("iface %p, frame %p.\n", iface, frame);
3482 if (frame)
3484 hr = IDirect3DRMFrame_QueryInterface(frame, &IID_IDirect3DRMFrame3, (void **)&animation->frame);
3485 if (SUCCEEDED(hr))
3486 IDirect3DRMFrame3_Release(animation->frame);
3488 else
3489 animation->frame = NULL;
3491 return hr;
3494 static HRESULT WINAPI d3drm_animation1_SetTime(IDirect3DRMAnimation *iface, D3DVALUE time)
3496 FIXME("iface %p, time %.8e.\n", iface, time);
3498 return E_NOTIMPL;
3501 static D3DRMANIMATIONOPTIONS WINAPI d3drm_animation2_GetOptions(IDirect3DRMAnimation2 *iface)
3503 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3505 TRACE("iface %p.\n", iface);
3507 return animation->options;
3510 static D3DRMANIMATIONOPTIONS WINAPI d3drm_animation1_GetOptions(IDirect3DRMAnimation *iface)
3512 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation(iface);
3514 TRACE("iface %p.\n", iface);
3516 return d3drm_animation2_GetOptions(&animation->IDirect3DRMAnimation2_iface);
3519 static HRESULT WINAPI d3drm_animation2_SetFrame(IDirect3DRMAnimation2 *iface, IDirect3DRMFrame3 *frame)
3521 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3523 TRACE("iface %p, frame %p.\n", iface, frame);
3525 animation->frame = frame;
3527 return D3DRM_OK;
3530 static HRESULT WINAPI d3drm_animation2_SetTime(IDirect3DRMAnimation2 *iface, D3DVALUE time)
3532 FIXME("iface %p, time %.8e.\n", iface, time);
3534 return E_NOTIMPL;
3537 static HRESULT WINAPI d3drm_animation2_GetFrame(IDirect3DRMAnimation2 *iface, IDirect3DRMFrame3 **frame)
3539 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3541 TRACE("iface %p, frame %p.\n", iface, frame);
3543 if (!frame)
3544 return D3DRMERR_BADVALUE;
3546 *frame = animation->frame;
3547 if (*frame)
3548 IDirect3DRMFrame3_AddRef(*frame);
3550 return D3DRM_OK;
3553 static HRESULT WINAPI d3drm_animation2_DeleteKeyByID(IDirect3DRMAnimation2 *iface, DWORD id)
3555 FIXME("iface %p, id %#x.\n", iface, id);
3557 return E_NOTIMPL;
3560 static HRESULT WINAPI d3drm_animation2_ModifyKey(IDirect3DRMAnimation2 *iface, D3DRMANIMATIONKEY *key)
3562 FIXME("iface %p, key %p.\n", iface, key);
3564 return E_NOTIMPL;
3567 static HRESULT WINAPI d3drm_animation2_GetKeys(IDirect3DRMAnimation2 *iface, D3DVALUE time_min, D3DVALUE time_max,
3568 DWORD *key_count, D3DRMANIMATIONKEY *keys)
3570 struct d3drm_animation *animation = impl_from_IDirect3DRMAnimation2(iface);
3571 const struct d3drm_animation_key *key;
3572 SIZE_T count, i;
3574 TRACE("iface %p, time min %.8e, time max %.8e, key_count %p, keys %p.\n",
3575 iface, time_min, time_max, key_count, keys);
3577 if (!key_count)
3578 return D3DRMERR_BADVALUE;
3580 *key_count = 0;
3582 if ((key = d3drm_animation_get_range(&animation->rotate, time_min, time_max, &count)))
3584 if (keys)
3586 for (i = 0; i < count; ++i)
3588 keys[i].dwSize = sizeof(*keys);
3589 keys[i].dwKeyType = D3DRMANIMATION_ROTATEKEY;
3590 keys[i].dvTime = key[i].time;
3591 keys[i].dwID = 0; /* FIXME */
3592 keys[i].u.dqRotateKey = key[i].u.rotate;
3594 keys += count;
3596 *key_count += count;
3599 if ((key = d3drm_animation_get_range(&animation->position, time_min, time_max, &count)))
3601 if (keys)
3603 for (i = 0; i < count; ++i)
3605 keys[i].dwSize = sizeof(*keys);
3606 keys[i].dwKeyType = D3DRMANIMATION_POSITIONKEY;
3607 keys[i].dvTime = key[i].time;
3608 keys[i].dwID = 0; /* FIXME */
3609 keys[i].u.dvPositionKey = key[i].u.position;
3611 keys += count;
3613 *key_count += count;
3616 if ((key = d3drm_animation_get_range(&animation->scale, time_min, time_max, &count)))
3618 if (keys)
3620 for (i = 0; keys && i < count; ++i)
3622 keys[i].dwSize = sizeof(*keys);
3623 keys[i].dwKeyType = D3DRMANIMATION_SCALEKEY;
3624 keys[i].dvTime = key[i].time;
3625 keys[i].dwID = 0; /* FIXME */
3626 keys[i].u.dvScaleKey = key[i].u.scale;
3628 keys += count;
3630 *key_count += count;
3633 return *key_count ? D3DRM_OK : D3DRMERR_NOSUCHKEY;
3636 static const struct IDirect3DRMAnimationVtbl d3drm_animation1_vtbl =
3638 d3drm_animation1_QueryInterface,
3639 d3drm_animation1_AddRef,
3640 d3drm_animation1_Release,
3641 d3drm_animation1_Clone,
3642 d3drm_animation1_AddDestroyCallback,
3643 d3drm_animation1_DeleteDestroyCallback,
3644 d3drm_animation1_SetAppData,
3645 d3drm_animation1_GetAppData,
3646 d3drm_animation1_SetName,
3647 d3drm_animation1_GetName,
3648 d3drm_animation1_GetClassName,
3649 d3drm_animation1_SetOptions,
3650 d3drm_animation1_AddRotateKey,
3651 d3drm_animation1_AddPositionKey,
3652 d3drm_animation1_AddScaleKey,
3653 d3drm_animation1_DeleteKey,
3654 d3drm_animation1_SetFrame,
3655 d3drm_animation1_SetTime,
3656 d3drm_animation1_GetOptions,
3659 static const struct IDirect3DRMAnimation2Vtbl d3drm_animation2_vtbl =
3661 d3drm_animation2_QueryInterface,
3662 d3drm_animation2_AddRef,
3663 d3drm_animation2_Release,
3664 d3drm_animation2_Clone,
3665 d3drm_animation2_AddDestroyCallback,
3666 d3drm_animation2_DeleteDestroyCallback,
3667 d3drm_animation2_SetAppData,
3668 d3drm_animation2_GetAppData,
3669 d3drm_animation2_SetName,
3670 d3drm_animation2_GetName,
3671 d3drm_animation2_GetClassName,
3672 d3drm_animation2_SetOptions,
3673 d3drm_animation2_AddRotateKey,
3674 d3drm_animation2_AddPositionKey,
3675 d3drm_animation2_AddScaleKey,
3676 d3drm_animation2_DeleteKey,
3677 d3drm_animation2_SetFrame,
3678 d3drm_animation2_SetTime,
3679 d3drm_animation2_GetOptions,
3680 d3drm_animation2_GetFrame,
3681 d3drm_animation2_DeleteKeyByID,
3682 d3drm_animation2_AddKey,
3683 d3drm_animation2_ModifyKey,
3684 d3drm_animation2_GetKeys,
3687 HRESULT d3drm_animation_create(struct d3drm_animation **animation, IDirect3DRM *d3drm)
3689 static const char classname[] = "Animation";
3690 struct d3drm_animation *object;
3691 HRESULT hr = D3DRM_OK;
3693 TRACE("animation %p, d3drm %p.\n", animation, d3drm);
3695 if (!(object = heap_alloc_zero(sizeof(*object))))
3696 return E_OUTOFMEMORY;
3698 object->IDirect3DRMAnimation_iface.lpVtbl = &d3drm_animation1_vtbl;
3699 object->IDirect3DRMAnimation2_iface.lpVtbl = &d3drm_animation2_vtbl;
3700 object->d3drm = d3drm;
3701 object->ref = 1;
3702 object->options = D3DRMANIMATION_CLOSED | D3DRMANIMATION_LINEARPOSITION;
3704 d3drm_object_init(&object->obj, classname);
3706 IDirect3DRM_AddRef(object->d3drm);
3708 *animation = object;
3710 return hr;