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
23 #include "wine/debug.h"
30 #include "d3drm_private.h"
32 WINE_DEFAULT_DEBUG_CHANNEL(d3drm
);
34 static D3DRMMATRIX4D identity
= {
35 { 1.0f
, 0.0f
, 0.0f
, 0.0f
},
36 { 0.0f
, 1.0f
, 0.0f
, 0.0f
},
37 { 0.0f
, 0.0f
, 1.0f
, 0.0f
},
38 { 0.0f
, 0.0f
, 0.0f
, 1.0f
}
43 IDirect3DRMFrame2 IDirect3DRMFrame2_iface
;
44 IDirect3DRMFrame3 IDirect3DRMFrame3_iface
;
46 struct d3drm_frame
*parent
;
48 ULONG children_capacity
;
49 IDirect3DRMFrame3
** children
;
51 ULONG visuals_capacity
;
52 IDirect3DRMVisual
** visuals
;
54 ULONG lights_capacity
;
55 IDirect3DRMLight
** lights
;
56 D3DRMMATRIX4D transform
;
57 D3DCOLOR scenebackground
;
60 struct d3drm_frame_array
62 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface
;
65 IDirect3DRMFrame
**frames
;
68 struct d3drm_visual_array
70 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface
;
73 IDirect3DRMVisual
**visuals
;
76 struct d3drm_light_array
78 IDirect3DRMLightArray IDirect3DRMLightArray_iface
;
81 IDirect3DRMLight
**lights
;
84 static inline struct d3drm_frame
*impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2
*iface
)
86 return CONTAINING_RECORD(iface
, struct d3drm_frame
, IDirect3DRMFrame2_iface
);
89 static inline struct d3drm_frame
*impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3
*iface
)
91 return CONTAINING_RECORD(iface
, struct d3drm_frame
, IDirect3DRMFrame3_iface
);
94 static inline struct d3drm_frame
*unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3
*iface
);
96 static inline struct d3drm_frame_array
*impl_from_IDirect3DRMFrameArray(IDirect3DRMFrameArray
*iface
)
98 return CONTAINING_RECORD(iface
, struct d3drm_frame_array
, IDirect3DRMFrameArray_iface
);
101 static inline struct d3drm_visual_array
*impl_from_IDirect3DRMVisualArray(IDirect3DRMVisualArray
*iface
)
103 return CONTAINING_RECORD(iface
, struct d3drm_visual_array
, IDirect3DRMVisualArray_iface
);
106 static inline struct d3drm_light_array
*impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray
*iface
)
108 return CONTAINING_RECORD(iface
, struct d3drm_light_array
, IDirect3DRMLightArray_iface
);
111 static HRESULT WINAPI
d3drm_frame_array_QueryInterface(IDirect3DRMFrameArray
*iface
, REFIID riid
, void **out
)
113 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
115 if (IsEqualGUID(riid
, &IID_IDirect3DRMFrameArray
)
116 || IsEqualGUID(riid
, &IID_IUnknown
))
118 IDirect3DRMFrameArray_AddRef(iface
);
123 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
126 return E_NOINTERFACE
;
129 static ULONG WINAPI
d3drm_frame_array_AddRef(IDirect3DRMFrameArray
*iface
)
131 struct d3drm_frame_array
*array
= impl_from_IDirect3DRMFrameArray(iface
);
132 ULONG refcount
= InterlockedIncrement(&array
->ref
);
134 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
139 static ULONG WINAPI
d3drm_frame_array_Release(IDirect3DRMFrameArray
*iface
)
141 struct d3drm_frame_array
*array
= impl_from_IDirect3DRMFrameArray(iface
);
142 ULONG refcount
= InterlockedDecrement(&array
->ref
);
145 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
149 for (i
= 0; i
< array
->size
; ++i
)
151 IDirect3DRMFrame_Release(array
->frames
[i
]);
153 HeapFree(GetProcessHeap(), 0, array
->frames
);
154 HeapFree(GetProcessHeap(), 0, array
);
160 static DWORD WINAPI
d3drm_frame_array_GetSize(IDirect3DRMFrameArray
*iface
)
162 struct d3drm_frame_array
*array
= impl_from_IDirect3DRMFrameArray(iface
);
164 TRACE("iface %p.\n", iface
);
169 static HRESULT WINAPI
d3drm_frame_array_GetElement(IDirect3DRMFrameArray
*iface
,
170 DWORD index
, IDirect3DRMFrame
**frame
)
172 struct d3drm_frame_array
*array
= impl_from_IDirect3DRMFrameArray(iface
);
174 TRACE("iface %p, index %u, frame %p.\n", iface
, index
, frame
);
177 return D3DRMERR_BADVALUE
;
179 if (index
>= array
->size
)
182 return D3DRMERR_BADVALUE
;
185 IDirect3DRMFrame_AddRef(array
->frames
[index
]);
186 *frame
= array
->frames
[index
];
191 static const struct IDirect3DRMFrameArrayVtbl d3drm_frame_array_vtbl
=
193 d3drm_frame_array_QueryInterface
,
194 d3drm_frame_array_AddRef
,
195 d3drm_frame_array_Release
,
196 d3drm_frame_array_GetSize
,
197 d3drm_frame_array_GetElement
,
200 static struct d3drm_frame_array
*d3drm_frame_array_create(void)
202 struct d3drm_frame_array
*array
;
204 if (!(array
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*array
))))
207 array
->IDirect3DRMFrameArray_iface
.lpVtbl
= &d3drm_frame_array_vtbl
;
213 static HRESULT WINAPI
d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray
*iface
, REFIID riid
, void **out
)
215 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
217 if (IsEqualGUID(riid
, &IID_IDirect3DRMVisualArray
)
218 || IsEqualGUID(riid
, &IID_IUnknown
))
220 IDirect3DRMVisualArray_AddRef(iface
);
225 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
228 return E_NOINTERFACE
;
231 static ULONG WINAPI
d3drm_visual_array_AddRef(IDirect3DRMVisualArray
*iface
)
233 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
234 ULONG refcount
= InterlockedIncrement(&array
->ref
);
236 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
241 static ULONG WINAPI
d3drm_visual_array_Release(IDirect3DRMVisualArray
*iface
)
243 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
244 ULONG refcount
= InterlockedDecrement(&array
->ref
);
247 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
251 for (i
= 0; i
< array
->size
; ++i
)
253 IDirect3DRMVisual_Release(array
->visuals
[i
]);
255 HeapFree(GetProcessHeap(), 0, array
->visuals
);
256 HeapFree(GetProcessHeap(), 0, array
);
262 static DWORD WINAPI
d3drm_visual_array_GetSize(IDirect3DRMVisualArray
*iface
)
264 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
266 TRACE("iface %p.\n", iface
);
271 static HRESULT WINAPI
d3drm_visual_array_GetElement(IDirect3DRMVisualArray
*iface
,
272 DWORD index
, IDirect3DRMVisual
**visual
)
274 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
276 TRACE("iface %p, index %u, visual %p.\n", iface
, index
, visual
);
279 return D3DRMERR_BADVALUE
;
281 if (index
>= array
->size
)
284 return D3DRMERR_BADVALUE
;
287 IDirect3DRMVisual_AddRef(array
->visuals
[index
]);
288 *visual
= array
->visuals
[index
];
293 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl
=
295 d3drm_visual_array_QueryInterface
,
296 d3drm_visual_array_AddRef
,
297 d3drm_visual_array_Release
,
298 d3drm_visual_array_GetSize
,
299 d3drm_visual_array_GetElement
,
302 static struct d3drm_visual_array
*d3drm_visual_array_create(void)
304 struct d3drm_visual_array
*array
;
306 if (!(array
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*array
))))
309 array
->IDirect3DRMVisualArray_iface
.lpVtbl
= &d3drm_visual_array_vtbl
;
315 static HRESULT WINAPI
d3drm_light_array_QueryInterface(IDirect3DRMLightArray
*iface
, REFIID riid
, void **out
)
317 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
319 if (IsEqualGUID(riid
, &IID_IDirect3DRMLightArray
)
320 || IsEqualGUID(riid
, &IID_IUnknown
))
322 IDirect3DRMLightArray_AddRef(iface
);
327 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
330 return E_NOINTERFACE
;
333 static ULONG WINAPI
d3drm_light_array_AddRef(IDirect3DRMLightArray
*iface
)
335 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
336 ULONG refcount
= InterlockedIncrement(&array
->ref
);
338 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
343 static ULONG WINAPI
d3drm_light_array_Release(IDirect3DRMLightArray
*iface
)
345 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
346 ULONG refcount
= InterlockedDecrement(&array
->ref
);
349 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
353 for (i
= 0; i
< array
->size
; ++i
)
355 IDirect3DRMLight_Release(array
->lights
[i
]);
357 HeapFree(GetProcessHeap(), 0, array
->lights
);
358 HeapFree(GetProcessHeap(), 0, array
);
364 static DWORD WINAPI
d3drm_light_array_GetSize(IDirect3DRMLightArray
*iface
)
366 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
368 TRACE("iface %p.\n", iface
);
373 static HRESULT WINAPI
d3drm_light_array_GetElement(IDirect3DRMLightArray
*iface
,
374 DWORD index
, IDirect3DRMLight
**light
)
376 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
378 TRACE("iface %p, index %u, light %p.\n", iface
, index
, light
);
381 return D3DRMERR_BADVALUE
;
383 if (index
>= array
->size
)
386 return D3DRMERR_BADVALUE
;
389 IDirect3DRMLight_AddRef(array
->lights
[index
]);
390 *light
= array
->lights
[index
];
395 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl
=
397 d3drm_light_array_QueryInterface
,
398 d3drm_light_array_AddRef
,
399 d3drm_light_array_Release
,
400 d3drm_light_array_GetSize
,
401 d3drm_light_array_GetElement
,
404 static struct d3drm_light_array
*d3drm_light_array_create(void)
406 struct d3drm_light_array
*array
;
408 if (!(array
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*array
))))
411 array
->IDirect3DRMLightArray_iface
.lpVtbl
= &d3drm_light_array_vtbl
;
417 static HRESULT WINAPI
d3drm_frame2_QueryInterface(IDirect3DRMFrame2
*iface
, REFIID riid
, void **out
)
419 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
421 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
423 if (IsEqualGUID(riid
, &IID_IDirect3DRMFrame2
)
424 || IsEqualGUID(riid
, &IID_IDirect3DRMFrame
)
425 || IsEqualGUID(riid
, &IID_IUnknown
))
427 *out
= &frame
->IDirect3DRMFrame2_iface
;
429 else if (IsEqualGUID(riid
, &IID_IDirect3DRMFrame3
))
431 *out
= &frame
->IDirect3DRMFrame3_iface
;
436 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
437 return E_NOINTERFACE
;
440 IUnknown_AddRef((IUnknown
*)*out
);
444 static ULONG WINAPI
d3drm_frame2_AddRef(IDirect3DRMFrame2
*iface
)
446 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
447 ULONG refcount
= InterlockedIncrement(&frame
->ref
);
449 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
454 static ULONG WINAPI
d3drm_frame2_Release(IDirect3DRMFrame2
*iface
)
456 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
457 ULONG refcount
= InterlockedDecrement(&frame
->ref
);
460 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
464 for (i
= 0; i
< frame
->nb_children
; ++i
)
466 IDirect3DRMFrame3_Release(frame
->children
[i
]);
468 HeapFree(GetProcessHeap(), 0, frame
->children
);
469 for (i
= 0; i
< frame
->nb_visuals
; ++i
)
471 IDirect3DRMVisual_Release(frame
->visuals
[i
]);
473 HeapFree(GetProcessHeap(), 0, frame
->visuals
);
474 for (i
= 0; i
< frame
->nb_lights
; ++i
)
476 IDirect3DRMLight_Release(frame
->lights
[i
]);
478 HeapFree(GetProcessHeap(), 0, frame
->lights
);
479 HeapFree(GetProcessHeap(), 0, frame
);
485 static HRESULT WINAPI
d3drm_frame2_Clone(IDirect3DRMFrame2
*iface
,
486 IUnknown
*outer
, REFIID iid
, void **out
)
488 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
493 static HRESULT WINAPI
d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2
*iface
,
494 D3DRMOBJECTCALLBACK cb
, void *ctx
)
496 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
501 static HRESULT WINAPI
d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2
*iface
,
502 D3DRMOBJECTCALLBACK cb
, void *ctx
)
504 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
509 static HRESULT WINAPI
d3drm_frame2_SetAppData(IDirect3DRMFrame2
*iface
, DWORD data
)
511 FIXME("iface %p, data %#x stub!\n", iface
, data
);
516 static DWORD WINAPI
d3drm_frame2_GetAppData(IDirect3DRMFrame2
*iface
)
518 FIXME("iface %p stub!\n", iface
);
523 static HRESULT WINAPI
d3drm_frame2_SetName(IDirect3DRMFrame2
*iface
, const char *name
)
525 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
530 static HRESULT WINAPI
d3drm_frame2_GetName(IDirect3DRMFrame2
*iface
, DWORD
*size
, char *name
)
532 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
537 static HRESULT WINAPI
d3drm_frame2_GetClassName(IDirect3DRMFrame2
*iface
, DWORD
*size
, char *name
)
539 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
541 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
543 return IDirect3DRMFrame3_GetClassName(&frame
->IDirect3DRMFrame3_iface
, size
, name
);
546 static HRESULT WINAPI
d3drm_frame2_AddChild(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*child
)
548 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
549 IDirect3DRMFrame3
*child3
;
552 TRACE("iface %p, child %p.\n", iface
, child
);
555 return D3DRMERR_BADOBJECT
;
556 hr
= IDirect3DRMFrame_QueryInterface(child
, &IID_IDirect3DRMFrame3
, (void **)&child3
);
558 return D3DRMERR_BADOBJECT
;
559 IDirect3DRMFrame_Release(child
);
561 return IDirect3DRMFrame3_AddChild(&frame
->IDirect3DRMFrame3_iface
, child3
);
564 static HRESULT WINAPI
d3drm_frame2_AddLight(IDirect3DRMFrame2
*iface
, IDirect3DRMLight
*light
)
566 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
568 TRACE("iface %p, light %p.\n", iface
, light
);
570 return IDirect3DRMFrame3_AddLight(&frame
->IDirect3DRMFrame3_iface
, light
);
573 static HRESULT WINAPI
d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2
*iface
,
574 D3DRMFRAMEMOVECALLBACK cb
, void *ctx
)
576 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
581 static HRESULT WINAPI
d3drm_frame2_AddTransform(IDirect3DRMFrame2
*iface
, D3DRMCOMBINETYPE type
, D3DRMMATRIX4D matrix
)
583 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
585 TRACE("iface %p, type %#x, matrix %p.\n", iface
, type
, matrix
);
587 return IDirect3DRMFrame3_AddTransform(&frame
->IDirect3DRMFrame3_iface
, type
, matrix
);
590 static HRESULT WINAPI
d3drm_frame2_AddTranslation(IDirect3DRMFrame2
*iface
,
591 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
593 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface
, type
, x
, y
, z
);
598 static HRESULT WINAPI
d3drm_frame2_AddScale(IDirect3DRMFrame2
*iface
,
599 D3DRMCOMBINETYPE type
, D3DVALUE sx
, D3DVALUE sy
, D3DVALUE sz
)
601 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface
, type
, sx
, sy
, sz
);
606 static HRESULT WINAPI
d3drm_frame2_AddRotation(IDirect3DRMFrame2
*iface
,
607 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
609 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface
, type
, x
, y
, z
, theta
);
614 static HRESULT WINAPI
d3drm_frame2_AddVisual(IDirect3DRMFrame2
*iface
, IDirect3DRMVisual
*visual
)
616 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
618 TRACE("iface %p, visual %p.\n", iface
, visual
);
620 return IDirect3DRMFrame3_AddVisual(&frame
->IDirect3DRMFrame3_iface
, (IUnknown
*)visual
);
623 static HRESULT WINAPI
d3drm_frame2_GetChildren(IDirect3DRMFrame2
*iface
, IDirect3DRMFrameArray
**children
)
625 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
627 TRACE("iface %p, children %p.\n", iface
, children
);
629 return IDirect3DRMFrame3_GetChildren(&frame
->IDirect3DRMFrame3_iface
, children
);
632 static D3DCOLOR WINAPI
d3drm_frame2_GetColor(IDirect3DRMFrame2
*iface
)
634 FIXME("iface %p stub!\n", iface
);
639 static HRESULT WINAPI
d3drm_frame2_GetLights(IDirect3DRMFrame2
*iface
, IDirect3DRMLightArray
**lights
)
641 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
643 TRACE("iface %p, lights %p.\n", iface
, lights
);
645 return IDirect3DRMFrame3_GetLights(&frame
->IDirect3DRMFrame3_iface
, lights
);
648 static D3DRMMATERIALMODE WINAPI
d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2
*iface
)
650 FIXME("iface %p stub!\n", iface
);
652 return D3DRMMATERIAL_FROMPARENT
;
655 static HRESULT WINAPI
d3drm_frame2_GetParent(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
**parent
)
657 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
659 TRACE("iface %p, parent %p.\n", iface
, parent
);
662 return D3DRMERR_BADVALUE
;
666 *parent
= (IDirect3DRMFrame
*)&frame
->parent
->IDirect3DRMFrame2_iface
;
667 IDirect3DRMFrame_AddRef(*parent
);
677 static HRESULT WINAPI
d3drm_frame2_GetPosition(IDirect3DRMFrame2
*iface
,
678 IDirect3DRMFrame
*reference
, D3DVECTOR
*position
)
680 FIXME("iface %p, reference %p, position %p stub!\n", iface
, reference
, position
);
685 static HRESULT WINAPI
d3drm_frame2_GetRotation(IDirect3DRMFrame2
*iface
,
686 IDirect3DRMFrame
*reference
, D3DVECTOR
*axis
, D3DVALUE
*theta
)
688 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface
, reference
, axis
, theta
);
693 static HRESULT WINAPI
d3drm_frame2_GetScene(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
**scene
)
695 FIXME("iface %p, scene %p stub!\n", iface
, scene
);
700 static D3DRMSORTMODE WINAPI
d3drm_frame2_GetSortMode(IDirect3DRMFrame2
*iface
)
702 FIXME("iface %p stub!\n", iface
);
704 return D3DRMSORT_FROMPARENT
;
707 static HRESULT WINAPI
d3drm_frame2_GetTexture(IDirect3DRMFrame2
*iface
, IDirect3DRMTexture
**texture
)
709 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
714 static HRESULT WINAPI
d3drm_frame2_GetTransform(IDirect3DRMFrame2
*iface
, D3DRMMATRIX4D matrix
)
716 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
718 TRACE("iface %p, matrix %p.\n", iface
, matrix
);
720 memcpy(matrix
, frame
->transform
, sizeof(D3DRMMATRIX4D
));
725 static HRESULT WINAPI
d3drm_frame2_GetVelocity(IDirect3DRMFrame2
*iface
,
726 IDirect3DRMFrame
*reference
, D3DVECTOR
*velocity
, BOOL with_rotation
)
728 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
729 iface
, reference
, velocity
, with_rotation
);
734 static HRESULT WINAPI
d3drm_frame2_GetOrientation(IDirect3DRMFrame2
*iface
,
735 IDirect3DRMFrame
*reference
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
737 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface
, reference
, dir
, up
);
742 static HRESULT WINAPI
d3drm_frame2_GetVisuals(IDirect3DRMFrame2
*iface
, IDirect3DRMVisualArray
**visuals
)
744 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
745 struct d3drm_visual_array
*array
;
747 TRACE("iface %p, visuals %p.\n", iface
, visuals
);
750 return D3DRMERR_BADVALUE
;
752 if (!(array
= d3drm_visual_array_create()))
753 return E_OUTOFMEMORY
;
755 array
->size
= frame
->nb_visuals
;
756 if (frame
->nb_visuals
)
760 if (!(array
->visuals
= HeapAlloc(GetProcessHeap(), 0, frame
->nb_visuals
* sizeof(*array
->visuals
))))
762 HeapFree(GetProcessHeap(), 0, array
);
763 return E_OUTOFMEMORY
;
765 for (i
= 0; i
< frame
->nb_visuals
; ++i
)
767 array
->visuals
[i
] = frame
->visuals
[i
];
768 IDirect3DRMVisual_AddRef(frame
->visuals
[i
]);
772 *visuals
= &array
->IDirect3DRMVisualArray_iface
;
777 static HRESULT WINAPI
d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2
*iface
, BOOL
*wrap_u
, BOOL
*wrap_v
)
779 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface
, wrap_u
, wrap_v
);
784 static HRESULT WINAPI
d3drm_frame2_InverseTransform(IDirect3DRMFrame2
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
786 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
791 static HRESULT WINAPI
d3drm_frame2_Load(IDirect3DRMFrame2
*iface
, void *filename
,
792 void *name
, D3DRMLOADOPTIONS flags
, D3DRMLOADTEXTURECALLBACK cb
, void *ctx
)
794 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
795 iface
, filename
, name
, flags
, cb
, ctx
);
800 static HRESULT WINAPI
d3drm_frame2_LookAt(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*target
,
801 IDirect3DRMFrame
*reference
, D3DRMFRAMECONSTRAINT constraint
)
803 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface
, target
, reference
, constraint
);
808 static HRESULT WINAPI
d3drm_frame2_Move(IDirect3DRMFrame2
*iface
, D3DVALUE delta
)
810 FIXME("iface %p, delta %.8e stub!\n", iface
, delta
);
815 static HRESULT WINAPI
d3drm_frame2_DeleteChild(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*child
)
817 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
818 IDirect3DRMFrame3
*child3
;
821 TRACE("iface %p, child %p.\n", iface
, child
);
824 return D3DRMERR_BADOBJECT
;
825 if (FAILED(hr
= IDirect3DRMFrame_QueryInterface(child
, &IID_IDirect3DRMFrame3
, (void **)&child3
)))
826 return D3DRMERR_BADOBJECT
;
827 IDirect3DRMFrame_Release(child
);
829 return IDirect3DRMFrame3_DeleteChild(&frame
->IDirect3DRMFrame3_iface
, child3
);
832 static HRESULT WINAPI
d3drm_frame2_DeleteLight(IDirect3DRMFrame2
*iface
, IDirect3DRMLight
*light
)
834 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
836 TRACE("iface %p, light %p.\n", iface
, light
);
838 return IDirect3DRMFrame3_DeleteLight(&frame
->IDirect3DRMFrame3_iface
, light
);
841 static HRESULT WINAPI
d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2
*iface
,
842 D3DRMFRAMEMOVECALLBACK cb
, void *ctx
)
844 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
849 static HRESULT WINAPI
d3drm_frame2_DeleteVisual(IDirect3DRMFrame2
*iface
, IDirect3DRMVisual
*visual
)
851 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
853 TRACE("iface %p, visual %p.\n", iface
, visual
);
855 return IDirect3DRMFrame3_DeleteVisual(&frame
->IDirect3DRMFrame3_iface
, (IUnknown
*)visual
);
858 static D3DCOLOR WINAPI
d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2
*iface
)
860 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
862 TRACE("iface %p.\n", iface
);
864 return IDirect3DRMFrame3_GetSceneBackground(&frame
->IDirect3DRMFrame3_iface
);
867 static HRESULT WINAPI
d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2
*iface
,
868 IDirectDrawSurface
**surface
)
870 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
875 static D3DCOLOR WINAPI
d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2
*iface
)
877 FIXME("iface %p stub!\n", iface
);
882 static BOOL WINAPI
d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2
*iface
)
884 FIXME("iface %p stub!\n", iface
);
889 static D3DRMFOGMODE WINAPI
d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2
*iface
)
891 FIXME("iface %p stub!\n", iface
);
893 return D3DRMFOG_LINEAR
;
896 static HRESULT WINAPI
d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2
*iface
,
897 D3DVALUE
*start
, D3DVALUE
*end
, D3DVALUE
*density
)
899 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface
, start
, end
, density
);
904 static HRESULT WINAPI
d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2
*iface
, D3DCOLOR color
)
906 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
908 TRACE("iface %p, color 0x%08x.\n", iface
, color
);
910 return IDirect3DRMFrame3_SetSceneBackground(&frame
->IDirect3DRMFrame3_iface
, color
);
913 static HRESULT WINAPI
d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2
*iface
,
914 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
916 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
918 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface
, red
, green
, blue
);
920 return IDirect3DRMFrame3_SetSceneBackgroundRGB(&frame
->IDirect3DRMFrame3_iface
, red
, green
, blue
);
923 static HRESULT WINAPI
d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2
*iface
, IDirectDrawSurface
*surface
)
925 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
930 static HRESULT WINAPI
d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2
*iface
, IDirect3DRMTexture
*texture
)
932 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
937 static HRESULT WINAPI
d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2
*iface
, BOOL enable
)
939 FIXME("iface %p, enable %#x stub!\n", iface
, enable
);
944 static HRESULT WINAPI
d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2
*iface
, D3DCOLOR color
)
946 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
951 static HRESULT WINAPI
d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2
*iface
, D3DRMFOGMODE mode
)
953 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
958 static HRESULT WINAPI
d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2
*iface
,
959 D3DVALUE start
, D3DVALUE end
, D3DVALUE density
)
961 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface
, start
, end
, density
);
966 static HRESULT WINAPI
d3drm_frame2_SetColor(IDirect3DRMFrame2
*iface
, D3DCOLOR color
)
968 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
973 static HRESULT WINAPI
d3drm_frame2_SetColorRGB(IDirect3DRMFrame2
*iface
,
974 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
976 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface
, red
, green
, blue
);
981 static D3DRMZBUFFERMODE WINAPI
d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2
*iface
)
983 FIXME("iface %p stub!\n", iface
);
985 return D3DRMZBUFFER_FROMPARENT
;
988 static HRESULT WINAPI
d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2
*iface
, D3DRMMATERIALMODE mode
)
990 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
995 static HRESULT WINAPI
d3drm_frame2_SetOrientation(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*reference
,
996 D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
, D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
)
998 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
999 iface
, reference
, dx
, dy
, dz
, ux
, uy
, uz
);
1004 static HRESULT WINAPI
d3drm_frame2_SetPosition(IDirect3DRMFrame2
*iface
,
1005 IDirect3DRMFrame
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
1007 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface
, reference
, x
, y
, z
);
1012 static HRESULT WINAPI
d3drm_frame2_SetRotation(IDirect3DRMFrame2
*iface
,
1013 IDirect3DRMFrame
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
1015 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1016 iface
, reference
, x
, y
, z
, theta
);
1021 static HRESULT WINAPI
d3drm_frame2_SetSortMode(IDirect3DRMFrame2
*iface
, D3DRMSORTMODE mode
)
1023 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1028 static HRESULT WINAPI
d3drm_frame2_SetTexture(IDirect3DRMFrame2
*iface
, IDirect3DRMTexture
*texture
)
1030 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1035 static HRESULT WINAPI
d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2
*iface
, BOOL wrap_u
, BOOL wrap_v
)
1037 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface
, wrap_u
, wrap_v
);
1042 static HRESULT WINAPI
d3drm_frame2_SetVelocity(IDirect3DRMFrame2
*iface
,
1043 IDirect3DRMFrame
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, BOOL with_rotation
)
1045 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
1046 iface
, reference
, x
, y
, z
, with_rotation
);
1051 static HRESULT WINAPI
d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2
*iface
, D3DRMZBUFFERMODE mode
)
1053 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1058 static HRESULT WINAPI
d3drm_frame2_Transform(IDirect3DRMFrame2
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
1060 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
1065 static HRESULT WINAPI
d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2
*iface
,
1066 D3DRMFRAMEMOVECALLBACK cb
, void *ctx
, DWORD flags
)
1068 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface
, cb
, ctx
, flags
);
1073 static HRESULT WINAPI
d3drm_frame2_GetBox(IDirect3DRMFrame2
*iface
, D3DRMBOX
*box
)
1075 FIXME("iface %p, box %p stub!\n", iface
, box
);
1080 static BOOL WINAPI
d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2
*iface
)
1082 FIXME("iface %p stub!\n", iface
);
1087 static HRESULT WINAPI
d3drm_frame2_GetAxes(IDirect3DRMFrame2
*iface
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
1089 FIXME("iface %p, dir %p, up %p stub!\n", iface
, dir
, up
);
1094 static HRESULT WINAPI
d3drm_frame2_GetMaterial(IDirect3DRMFrame2
*iface
, IDirect3DRMMaterial
**material
)
1096 FIXME("iface %p, material %p stub!\n", iface
, material
);
1101 static BOOL WINAPI
d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2
*iface
)
1103 FIXME("iface %p stub!\n", iface
);
1108 static HRESULT WINAPI
d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2
*iface
, D3DRMBOX
*box
)
1110 FIXME("iface %p, box %p stub!\n", iface
, box
);
1115 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl
=
1117 d3drm_frame2_QueryInterface
,
1118 d3drm_frame2_AddRef
,
1119 d3drm_frame2_Release
,
1121 d3drm_frame2_AddDestroyCallback
,
1122 d3drm_frame2_DeleteDestroyCallback
,
1123 d3drm_frame2_SetAppData
,
1124 d3drm_frame2_GetAppData
,
1125 d3drm_frame2_SetName
,
1126 d3drm_frame2_GetName
,
1127 d3drm_frame2_GetClassName
,
1128 d3drm_frame2_AddChild
,
1129 d3drm_frame2_AddLight
,
1130 d3drm_frame2_AddMoveCallback
,
1131 d3drm_frame2_AddTransform
,
1132 d3drm_frame2_AddTranslation
,
1133 d3drm_frame2_AddScale
,
1134 d3drm_frame2_AddRotation
,
1135 d3drm_frame2_AddVisual
,
1136 d3drm_frame2_GetChildren
,
1137 d3drm_frame2_GetColor
,
1138 d3drm_frame2_GetLights
,
1139 d3drm_frame2_GetMaterialMode
,
1140 d3drm_frame2_GetParent
,
1141 d3drm_frame2_GetPosition
,
1142 d3drm_frame2_GetRotation
,
1143 d3drm_frame2_GetScene
,
1144 d3drm_frame2_GetSortMode
,
1145 d3drm_frame2_GetTexture
,
1146 d3drm_frame2_GetTransform
,
1147 d3drm_frame2_GetVelocity
,
1148 d3drm_frame2_GetOrientation
,
1149 d3drm_frame2_GetVisuals
,
1150 d3drm_frame2_GetTextureTopology
,
1151 d3drm_frame2_InverseTransform
,
1153 d3drm_frame2_LookAt
,
1155 d3drm_frame2_DeleteChild
,
1156 d3drm_frame2_DeleteLight
,
1157 d3drm_frame2_DeleteMoveCallback
,
1158 d3drm_frame2_DeleteVisual
,
1159 d3drm_frame2_GetSceneBackground
,
1160 d3drm_frame2_GetSceneBackgroundDepth
,
1161 d3drm_frame2_GetSceneFogColor
,
1162 d3drm_frame2_GetSceneFogEnable
,
1163 d3drm_frame2_GetSceneFogMode
,
1164 d3drm_frame2_GetSceneFogParams
,
1165 d3drm_frame2_SetSceneBackground
,
1166 d3drm_frame2_SetSceneBackgroundRGB
,
1167 d3drm_frame2_SetSceneBackgroundDepth
,
1168 d3drm_frame2_SetSceneBackgroundImage
,
1169 d3drm_frame2_SetSceneFogEnable
,
1170 d3drm_frame2_SetSceneFogColor
,
1171 d3drm_frame2_SetSceneFogMode
,
1172 d3drm_frame2_SetSceneFogParams
,
1173 d3drm_frame2_SetColor
,
1174 d3drm_frame2_SetColorRGB
,
1175 d3drm_frame2_GetZbufferMode
,
1176 d3drm_frame2_SetMaterialMode
,
1177 d3drm_frame2_SetOrientation
,
1178 d3drm_frame2_SetPosition
,
1179 d3drm_frame2_SetRotation
,
1180 d3drm_frame2_SetSortMode
,
1181 d3drm_frame2_SetTexture
,
1182 d3drm_frame2_SetTextureTopology
,
1183 d3drm_frame2_SetVelocity
,
1184 d3drm_frame2_SetZbufferMode
,
1185 d3drm_frame2_Transform
,
1186 d3drm_frame2_AddMoveCallback2
,
1187 d3drm_frame2_GetBox
,
1188 d3drm_frame2_GetBoxEnable
,
1189 d3drm_frame2_GetAxes
,
1190 d3drm_frame2_GetMaterial
,
1191 d3drm_frame2_GetInheritAxes
,
1192 d3drm_frame2_GetHierarchyBox
,
1195 static HRESULT WINAPI
d3drm_frame3_QueryInterface(IDirect3DRMFrame3
*iface
, REFIID riid
, void **out
)
1197 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1199 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
1201 return d3drm_frame2_QueryInterface(&frame
->IDirect3DRMFrame2_iface
, riid
, out
);
1204 static ULONG WINAPI
d3drm_frame3_AddRef(IDirect3DRMFrame3
*iface
)
1206 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1208 TRACE("iface %p.\n", iface
);
1210 return d3drm_frame2_AddRef(&frame
->IDirect3DRMFrame2_iface
);
1213 static ULONG WINAPI
d3drm_frame3_Release(IDirect3DRMFrame3
*iface
)
1215 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1217 TRACE("iface %p.\n", iface
);
1219 return d3drm_frame2_Release(&frame
->IDirect3DRMFrame2_iface
);
1222 static HRESULT WINAPI
d3drm_frame3_Clone(IDirect3DRMFrame3
*iface
,
1223 IUnknown
*outer
, REFIID iid
, void **out
)
1225 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
1230 static HRESULT WINAPI
d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3
*iface
,
1231 D3DRMOBJECTCALLBACK cb
, void *ctx
)
1233 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1238 static HRESULT WINAPI
d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3
*iface
,
1239 D3DRMOBJECTCALLBACK cb
, void *ctx
)
1241 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1246 static HRESULT WINAPI
d3drm_frame3_SetAppData(IDirect3DRMFrame3
*iface
, DWORD data
)
1248 FIXME("iface %p, data %#x stub!\n", iface
, data
);
1253 static DWORD WINAPI
d3drm_frame3_GetAppData(IDirect3DRMFrame3
*iface
)
1255 FIXME("iface %p stub!\n", iface
);
1260 static HRESULT WINAPI
d3drm_frame3_SetName(IDirect3DRMFrame3
*iface
, const char *name
)
1262 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
1267 static HRESULT WINAPI
d3drm_frame3_GetName(IDirect3DRMFrame3
*iface
, DWORD
*size
, char *name
)
1269 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
1274 static HRESULT WINAPI
d3drm_frame3_GetClassName(IDirect3DRMFrame3
*iface
, DWORD
*size
, char *name
)
1276 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
1278 if (!size
|| *size
< strlen("Frame") || !name
)
1279 return E_INVALIDARG
;
1281 strcpy(name
, "Frame");
1282 *size
= sizeof("Frame");
1287 static HRESULT WINAPI
d3drm_frame3_AddChild(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*child
)
1289 struct d3drm_frame
*This
= impl_from_IDirect3DRMFrame3(iface
);
1290 struct d3drm_frame
*child_obj
= unsafe_impl_from_IDirect3DRMFrame3(child
);
1292 TRACE("iface %p, child %p.\n", iface
, child
);
1295 return D3DRMERR_BADOBJECT
;
1297 if (child_obj
->parent
)
1299 IDirect3DRMFrame3
* parent
= &child_obj
->parent
->IDirect3DRMFrame3_iface
;
1301 if (parent
== iface
)
1303 /* Passed frame is already a child so return success */
1308 /* Remove parent and continue */
1309 IDirect3DRMFrame3_DeleteChild(parent
, child
);
1313 if ((This
->nb_children
+ 1) > This
->children_capacity
)
1316 IDirect3DRMFrame3
** children
;
1318 if (!This
->children_capacity
)
1321 children
= HeapAlloc(GetProcessHeap(), 0, new_capacity
* sizeof(IDirect3DRMFrame3
*));
1325 new_capacity
= This
->children_capacity
* 2;
1326 children
= HeapReAlloc(GetProcessHeap(), 0, This
->children
, new_capacity
* sizeof(IDirect3DRMFrame3
*));
1330 return E_OUTOFMEMORY
;
1332 This
->children_capacity
= new_capacity
;
1333 This
->children
= children
;
1336 This
->children
[This
->nb_children
++] = child
;
1337 IDirect3DRMFrame3_AddRef(child
);
1338 child_obj
->parent
= This
;
1343 static HRESULT WINAPI
d3drm_frame3_AddLight(IDirect3DRMFrame3
*iface
, IDirect3DRMLight
*light
)
1345 struct d3drm_frame
*This
= impl_from_IDirect3DRMFrame3(iface
);
1347 IDirect3DRMLight
** lights
;
1349 TRACE("iface %p, light %p.\n", iface
, light
);
1352 return D3DRMERR_BADOBJECT
;
1354 /* Check if already existing and return gracefully without increasing ref count */
1355 for (i
= 0; i
< This
->nb_lights
; i
++)
1356 if (This
->lights
[i
] == light
)
1359 if ((This
->nb_lights
+ 1) > This
->lights_capacity
)
1363 if (!This
->lights_capacity
)
1366 lights
= HeapAlloc(GetProcessHeap(), 0, new_capacity
* sizeof(IDirect3DRMLight
*));
1370 new_capacity
= This
->lights_capacity
* 2;
1371 lights
= HeapReAlloc(GetProcessHeap(), 0, This
->lights
, new_capacity
* sizeof(IDirect3DRMLight
*));
1375 return E_OUTOFMEMORY
;
1377 This
->lights_capacity
= new_capacity
;
1378 This
->lights
= lights
;
1381 This
->lights
[This
->nb_lights
++] = light
;
1382 IDirect3DRMLight_AddRef(light
);
1387 static HRESULT WINAPI
d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3
*iface
,
1388 D3DRMFRAME3MOVECALLBACK cb
, void *ctx
, DWORD flags
)
1390 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface
, cb
, ctx
, flags
);
1395 static HRESULT WINAPI
d3drm_frame3_AddTransform(IDirect3DRMFrame3
*iface
,
1396 D3DRMCOMBINETYPE type
, D3DRMMATRIX4D matrix
)
1398 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1400 TRACE("iface %p, type %#x, matrix %p.\n", iface
, type
, matrix
);
1404 case D3DRMCOMBINE_REPLACE
:
1405 memcpy(frame
->transform
, matrix
, sizeof(D3DRMMATRIX4D
));
1408 case D3DRMCOMBINE_BEFORE
:
1409 FIXME("D3DRMCOMBINE_BEFORE not supported yed\n");
1412 case D3DRMCOMBINE_AFTER
:
1413 FIXME("D3DRMCOMBINE_AFTER not supported yed\n");
1417 WARN("Unknown Combine Type %u\n", type
);
1418 return D3DRMERR_BADVALUE
;
1424 static HRESULT WINAPI
d3drm_frame3_AddTranslation(IDirect3DRMFrame3
*iface
,
1425 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
1427 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface
, type
, x
, y
, z
);
1432 static HRESULT WINAPI
d3drm_frame3_AddScale(IDirect3DRMFrame3
*iface
,
1433 D3DRMCOMBINETYPE type
, D3DVALUE sx
, D3DVALUE sy
, D3DVALUE sz
)
1435 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface
, type
, sx
, sy
, sz
);
1440 static HRESULT WINAPI
d3drm_frame3_AddRotation(IDirect3DRMFrame3
*iface
,
1441 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
1443 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1444 iface
, type
, x
, y
, z
, theta
);
1449 static HRESULT WINAPI
d3drm_frame3_AddVisual(IDirect3DRMFrame3
*iface
, IUnknown
*visual
)
1451 struct d3drm_frame
*This
= impl_from_IDirect3DRMFrame3(iface
);
1453 IDirect3DRMVisual
** visuals
;
1455 TRACE("iface %p, visual %p.\n", iface
, visual
);
1458 return D3DRMERR_BADOBJECT
;
1460 /* Check if already existing and return gracefully without increasing ref count */
1461 for (i
= 0; i
< This
->nb_visuals
; i
++)
1462 if (This
->visuals
[i
] == (IDirect3DRMVisual
*)visual
)
1465 if ((This
->nb_visuals
+ 1) > This
->visuals_capacity
)
1469 if (!This
->visuals_capacity
)
1472 visuals
= HeapAlloc(GetProcessHeap(), 0, new_capacity
* sizeof(IDirect3DRMVisual
*));
1476 new_capacity
= This
->visuals_capacity
* 2;
1477 visuals
= HeapReAlloc(GetProcessHeap(), 0, This
->visuals
, new_capacity
* sizeof(IDirect3DRMVisual
*));
1481 return E_OUTOFMEMORY
;
1483 This
->visuals_capacity
= new_capacity
;
1484 This
->visuals
= visuals
;
1487 This
->visuals
[This
->nb_visuals
++] = (IDirect3DRMVisual
*)visual
;
1488 IDirect3DRMVisual_AddRef(visual
);
1493 static HRESULT WINAPI
d3drm_frame3_GetChildren(IDirect3DRMFrame3
*iface
, IDirect3DRMFrameArray
**children
)
1495 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1496 struct d3drm_frame_array
*array
;
1498 TRACE("iface %p, children %p.\n", iface
, children
);
1501 return D3DRMERR_BADVALUE
;
1503 if (!(array
= d3drm_frame_array_create()))
1504 return E_OUTOFMEMORY
;
1506 array
->size
= frame
->nb_children
;
1507 if (frame
->nb_children
)
1511 if (!(array
->frames
= HeapAlloc(GetProcessHeap(), 0, frame
->nb_children
* sizeof(*array
->frames
))))
1513 HeapFree(GetProcessHeap(), 0, array
);
1514 return E_OUTOFMEMORY
;
1516 for (i
= 0; i
< frame
->nb_children
; ++i
)
1518 IDirect3DRMFrame3_QueryInterface(frame
->children
[i
], &IID_IDirect3DRMFrame
, (void **)&array
->frames
[i
]);
1522 *children
= &array
->IDirect3DRMFrameArray_iface
;
1527 static D3DCOLOR WINAPI
d3drm_frame3_GetColor(IDirect3DRMFrame3
*iface
)
1529 FIXME("iface %p stub!\n", iface
);
1534 static HRESULT WINAPI
d3drm_frame3_GetLights(IDirect3DRMFrame3
*iface
, IDirect3DRMLightArray
**lights
)
1536 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1537 struct d3drm_light_array
*array
;
1539 TRACE("iface %p, lights %p.\n", iface
, lights
);
1542 return D3DRMERR_BADVALUE
;
1544 if (!(array
= d3drm_light_array_create()))
1545 return E_OUTOFMEMORY
;
1547 array
->size
= frame
->nb_lights
;
1548 if (frame
->nb_lights
)
1552 if (!(array
->lights
= HeapAlloc(GetProcessHeap(), 0, frame
->nb_lights
* sizeof(*array
->lights
))))
1554 HeapFree(GetProcessHeap(), 0, array
);
1555 return E_OUTOFMEMORY
;
1557 for (i
= 0; i
< frame
->nb_lights
; ++i
)
1559 IDirect3DRMLight_QueryInterface(frame
->lights
[i
], &IID_IDirect3DRMLight
, (void **)&array
->lights
[i
]);
1563 *lights
= &array
->IDirect3DRMLightArray_iface
;
1568 static D3DRMMATERIALMODE WINAPI
d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3
*iface
)
1570 FIXME("iface %p stub!\n", iface
);
1572 return D3DRMMATERIAL_FROMPARENT
;
1575 static HRESULT WINAPI
d3drm_frame3_GetParent(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
**parent
)
1577 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1579 TRACE("iface %p, parent %p.\n", iface
, parent
);
1582 return D3DRMERR_BADVALUE
;
1586 *parent
= &frame
->parent
->IDirect3DRMFrame3_iface
;
1587 IDirect3DRMFrame_AddRef(*parent
);
1597 static HRESULT WINAPI
d3drm_frame3_GetPosition(IDirect3DRMFrame3
*iface
,
1598 IDirect3DRMFrame3
*reference
, D3DVECTOR
*position
)
1600 FIXME("iface %p, reference %p, position %p stub!\n", iface
, reference
, position
);
1605 static HRESULT WINAPI
d3drm_frame3_GetRotation(IDirect3DRMFrame3
*iface
,
1606 IDirect3DRMFrame3
*reference
, D3DVECTOR
*axis
, D3DVALUE
*theta
)
1608 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface
, reference
, axis
, theta
);
1613 static HRESULT WINAPI
d3drm_frame3_GetScene(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
**scene
)
1615 FIXME("iface %p, scene %p stub!\n", iface
, scene
);
1620 static D3DRMSORTMODE WINAPI
d3drm_frame3_GetSortMode(IDirect3DRMFrame3
*iface
)
1622 FIXME("iface %p stub!\n", iface
);
1624 return D3DRMSORT_FROMPARENT
;
1627 static HRESULT WINAPI
d3drm_frame3_GetTexture(IDirect3DRMFrame3
*iface
, IDirect3DRMTexture3
**texture
)
1629 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1634 static HRESULT WINAPI
d3drm_frame3_GetTransform(IDirect3DRMFrame3
*iface
,
1635 IDirect3DRMFrame3
*reference
, D3DRMMATRIX4D matrix
)
1637 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1639 TRACE("iface %p, reference %p, matrix %p.\n", iface
, reference
, matrix
);
1642 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1644 memcpy(matrix
, frame
->transform
, sizeof(D3DRMMATRIX4D
));
1649 static HRESULT WINAPI
d3drm_frame3_GetVelocity(IDirect3DRMFrame3
*iface
,
1650 IDirect3DRMFrame3
*reference
, D3DVECTOR
*velocity
, BOOL with_rotation
)
1652 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1653 iface
, reference
, velocity
, with_rotation
);
1658 static HRESULT WINAPI
d3drm_frame3_GetOrientation(IDirect3DRMFrame3
*iface
,
1659 IDirect3DRMFrame3
*reference
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
1661 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface
, reference
, dir
, up
);
1666 static HRESULT WINAPI
d3drm_frame3_GetVisuals(IDirect3DRMFrame3
*iface
,
1667 DWORD
*count
, IUnknown
**visuals
)
1669 FIXME("iface %p, count %p, visuals %p stub!\n", iface
, count
, visuals
);
1674 static HRESULT WINAPI
d3drm_frame3_InverseTransform(IDirect3DRMFrame3
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
1676 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
1681 static HRESULT WINAPI
d3drm_frame3_Load(IDirect3DRMFrame3
*iface
, void *filename
,
1682 void *name
, D3DRMLOADOPTIONS flags
, D3DRMLOADTEXTURE3CALLBACK cb
, void *ctx
)
1684 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1685 iface
, filename
, name
, flags
, cb
, ctx
);
1690 static HRESULT WINAPI
d3drm_frame3_LookAt(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*target
,
1691 IDirect3DRMFrame3
*reference
, D3DRMFRAMECONSTRAINT constraint
)
1693 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface
, target
, reference
, constraint
);
1698 static HRESULT WINAPI
d3drm_frame3_Move(IDirect3DRMFrame3
*iface
, D3DVALUE delta
)
1700 FIXME("iface %p, delta %.8e stub!\n", iface
, delta
);
1705 static HRESULT WINAPI
d3drm_frame3_DeleteChild(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*child
)
1707 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1708 struct d3drm_frame
*child_impl
= unsafe_impl_from_IDirect3DRMFrame3(child
);
1711 TRACE("iface %p, child %p.\n", iface
, child
);
1714 return D3DRMERR_BADOBJECT
;
1716 /* Check if child exists */
1717 for (i
= 0; i
< frame
->nb_children
; ++i
)
1719 if (frame
->children
[i
] == child
)
1723 if (i
== frame
->nb_children
)
1724 return D3DRMERR_BADVALUE
;
1726 memmove(frame
->children
+ i
, frame
->children
+ i
+ 1, sizeof(*frame
->children
) * (frame
->nb_children
- 1 - i
));
1727 IDirect3DRMFrame3_Release(child
);
1728 child_impl
->parent
= NULL
;
1729 --frame
->nb_children
;
1734 static HRESULT WINAPI
d3drm_frame3_DeleteLight(IDirect3DRMFrame3
*iface
, IDirect3DRMLight
*light
)
1736 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1739 TRACE("iface %p, light %p.\n", iface
, light
);
1742 return D3DRMERR_BADOBJECT
;
1744 /* Check if visual exists */
1745 for (i
= 0; i
< frame
->nb_lights
; ++i
)
1747 if (frame
->lights
[i
] == light
)
1751 if (i
== frame
->nb_lights
)
1752 return D3DRMERR_BADVALUE
;
1754 memmove(frame
->lights
+ i
, frame
->lights
+ i
+ 1, sizeof(*frame
->lights
) * (frame
->nb_lights
- 1 - i
));
1755 IDirect3DRMLight_Release(light
);
1761 static HRESULT WINAPI
d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3
*iface
,
1762 D3DRMFRAME3MOVECALLBACK cb
, void *ctx
)
1764 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1769 static HRESULT WINAPI
d3drm_frame3_DeleteVisual(IDirect3DRMFrame3
*iface
, IUnknown
*visual
)
1771 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1774 TRACE("iface %p, visual %p.\n", iface
, visual
);
1777 return D3DRMERR_BADOBJECT
;
1779 /* Check if visual exists */
1780 for (i
= 0; i
< frame
->nb_visuals
; ++i
)
1782 if (frame
->visuals
[i
] == (IDirect3DRMVisual
*)visual
)
1786 if (i
== frame
->nb_visuals
)
1787 return D3DRMERR_BADVALUE
;
1789 memmove(frame
->visuals
+ i
, frame
->visuals
+ i
+ 1, sizeof(*frame
->visuals
) * (frame
->nb_visuals
- 1 - i
));
1790 IDirect3DRMVisual_Release(visual
);
1791 --frame
->nb_visuals
;
1796 static D3DCOLOR WINAPI
d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3
*iface
)
1798 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1800 TRACE("iface %p.\n", iface
);
1802 return frame
->scenebackground
;
1805 static HRESULT WINAPI
d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3
*iface
,
1806 IDirectDrawSurface
**surface
)
1808 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
1813 static D3DCOLOR WINAPI
d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3
*iface
)
1815 FIXME("iface %p stub!\n", iface
);
1820 static BOOL WINAPI
d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3
*iface
)
1822 FIXME("iface %p stub!\n", iface
);
1827 static D3DRMFOGMODE WINAPI
d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3
*iface
)
1829 FIXME("iface %p stub!\n", iface
);
1831 return D3DRMFOG_LINEAR
;
1834 static HRESULT WINAPI
d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3
*iface
,
1835 D3DVALUE
*start
, D3DVALUE
*end
, D3DVALUE
*density
)
1837 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface
, start
, end
, density
);
1842 static HRESULT WINAPI
d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3
*iface
, D3DCOLOR color
)
1844 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1846 TRACE("iface %p, color 0x%08x.\n", iface
, color
);
1848 frame
->scenebackground
= color
;
1853 static HRESULT WINAPI
d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3
*iface
,
1854 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
1856 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1858 TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface
, red
, green
, blue
);
1860 frame
->scenebackground
= RGBA_MAKE((BYTE
)(red
* 255.0f
),
1861 (BYTE
)(green
* 255.0f
), (BYTE
)(blue
* 255.0f
), 0xff);
1866 static HRESULT WINAPI
d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3
*iface
,
1867 IDirectDrawSurface
*surface
)
1869 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
1874 static HRESULT WINAPI
d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3
*iface
,
1875 IDirect3DRMTexture3
*texture
)
1877 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1882 static HRESULT WINAPI
d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3
*iface
, BOOL enable
)
1884 FIXME("iface %p, enable %#x stub!\n", iface
, enable
);
1889 static HRESULT WINAPI
d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3
*iface
, D3DCOLOR color
)
1891 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
1896 static HRESULT WINAPI
d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3
*iface
, D3DRMFOGMODE mode
)
1898 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1903 static HRESULT WINAPI
d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3
*iface
,
1904 D3DVALUE start
, D3DVALUE end
, D3DVALUE density
)
1906 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface
, start
, end
, density
);
1911 static HRESULT WINAPI
d3drm_frame3_SetColor(IDirect3DRMFrame3
*iface
, D3DCOLOR color
)
1913 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
1918 static HRESULT WINAPI
d3drm_frame3_SetColorRGB(IDirect3DRMFrame3
*iface
,
1919 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
1921 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface
, red
, green
, blue
);
1926 static D3DRMZBUFFERMODE WINAPI
d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3
*iface
)
1928 FIXME("iface %p stub!\n", iface
);
1930 return D3DRMZBUFFER_FROMPARENT
;
1933 static HRESULT WINAPI
d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3
*iface
, D3DRMMATERIALMODE mode
)
1935 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1940 static HRESULT WINAPI
d3drm_frame3_SetOrientation(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*reference
,
1941 D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
, D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
)
1943 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1944 iface
, reference
, dx
, dy
, dz
, ux
, uy
, uz
);
1949 static HRESULT WINAPI
d3drm_frame3_SetPosition(IDirect3DRMFrame3
*iface
,
1950 IDirect3DRMFrame3
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
1952 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface
, reference
, x
, y
, z
);
1957 static HRESULT WINAPI
d3drm_frame3_SetRotation(IDirect3DRMFrame3
*iface
,
1958 IDirect3DRMFrame3
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
1960 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1961 iface
, reference
, x
, y
, z
, theta
);
1966 static HRESULT WINAPI
d3drm_frame3_SetSortMode(IDirect3DRMFrame3
*iface
, D3DRMSORTMODE mode
)
1968 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1973 static HRESULT WINAPI
d3drm_frame3_SetTexture(IDirect3DRMFrame3
*iface
, IDirect3DRMTexture3
*texture
)
1975 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1980 static HRESULT WINAPI
d3drm_frame3_SetVelocity(IDirect3DRMFrame3
*iface
,
1981 IDirect3DRMFrame3
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, BOOL with_rotation
)
1983 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
1984 iface
, reference
, x
, y
, z
, with_rotation
);
1989 static HRESULT WINAPI
d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3
*iface
, D3DRMZBUFFERMODE mode
)
1991 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1996 static HRESULT WINAPI
d3drm_frame3_Transform(IDirect3DRMFrame3
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
1998 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
2003 static HRESULT WINAPI
d3drm_frame3_GetBox(IDirect3DRMFrame3
*iface
, D3DRMBOX
*box
)
2005 FIXME("iface %p, box %p stub!\n", iface
, box
);
2010 static BOOL WINAPI
d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3
*iface
)
2012 FIXME("iface %p stub!\n", iface
);
2017 static HRESULT WINAPI
d3drm_frame3_GetAxes(IDirect3DRMFrame3
*iface
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
2019 FIXME("iface %p, dir %p, up %p stub!\n", iface
, dir
, up
);
2024 static HRESULT WINAPI
d3drm_frame3_GetMaterial(IDirect3DRMFrame3
*iface
, IDirect3DRMMaterial2
**material
)
2026 FIXME("iface %p, material %p stub!\n", iface
, material
);
2031 static BOOL WINAPI
d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3
*iface
)
2033 FIXME("iface %p stub!\n", iface
);
2038 static HRESULT WINAPI
d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3
*iface
, D3DRMBOX
*box
)
2040 FIXME("iface %p, box %p stub!\n", iface
, box
);
2045 static HRESULT WINAPI
d3drm_frame3_SetBox(IDirect3DRMFrame3
*iface
, D3DRMBOX
*box
)
2047 FIXME("iface %p, box %p stub!\n", iface
, box
);
2052 static HRESULT WINAPI
d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3
*iface
, BOOL enable
)
2054 FIXME("iface %p, enable %#x stub!\n", iface
, enable
);
2059 static HRESULT WINAPI
d3drm_frame3_SetAxes(IDirect3DRMFrame3
*iface
,
2060 D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
, D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
)
2062 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2063 iface
, dx
, dy
, dz
, ux
, uy
, uz
);
2068 static HRESULT WINAPI
d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3
*iface
, BOOL inherit
)
2070 FIXME("iface %p, inherit %#x stub!\n", iface
, inherit
);
2075 static HRESULT WINAPI
d3drm_frame3_SetMaterial(IDirect3DRMFrame3
*iface
, IDirect3DRMMaterial2
*material
)
2077 FIXME("iface %p, material %p stub!\n", iface
, material
);
2082 static HRESULT WINAPI
d3drm_frame3_SetQuaternion(IDirect3DRMFrame3
*iface
,
2083 IDirect3DRMFrame3
*reference
, D3DRMQUATERNION
*q
)
2085 FIXME("iface %p, reference %p, q %p stub!\n", iface
, reference
, q
);
2090 static HRESULT WINAPI
d3drm_frame3_RayPick(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*reference
,
2091 D3DRMRAY
*ray
, DWORD flags
, IDirect3DRMPicked2Array
**visuals
)
2093 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2094 iface
, reference
, ray
, flags
, visuals
);
2099 static HRESULT WINAPI
d3drm_frame3_Save(IDirect3DRMFrame3
*iface
,
2100 const char *filename
, D3DRMXOFFORMAT format
, D3DRMSAVEOPTIONS flags
)
2102 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2103 iface
, debugstr_a(filename
), format
, flags
);
2108 static HRESULT WINAPI
d3drm_frame3_TransformVectors(IDirect3DRMFrame3
*iface
,
2109 IDirect3DRMFrame3
*reference
, DWORD num
, D3DVECTOR
*dst
, D3DVECTOR
*src
)
2111 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface
, reference
, num
, dst
, src
);
2116 static HRESULT WINAPI
d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3
*iface
,
2117 IDirect3DRMFrame3
*reference
, DWORD num
, D3DVECTOR
*dst
, D3DVECTOR
*src
)
2119 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface
, reference
, num
, dst
, src
);
2124 static HRESULT WINAPI
d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3
*iface
, DWORD flags
)
2126 FIXME("iface %p, flags %#x stub!\n", iface
, flags
);
2131 static HRESULT WINAPI
d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3
*iface
, DWORD
*flags
)
2133 FIXME("iface %p, flags %p stub!\n", iface
, flags
);
2138 static HRESULT WINAPI
d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3
*iface
, DWORD flags
)
2140 FIXME("iface %p, flags %#x stub!\n", iface
, flags
);
2145 static HRESULT WINAPI
d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3
*iface
, DWORD
*fog_mode
)
2147 FIXME("iface %p, fog_mode %p stub!\n", iface
, fog_mode
);
2152 static HRESULT WINAPI
d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3
*iface
,
2153 D3DRMMATERIALOVERRIDE
*override
)
2155 FIXME("iface %p, override %p stub!\n", iface
, override
);
2160 static HRESULT WINAPI
d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3
*iface
,
2161 D3DRMMATERIALOVERRIDE
*override
)
2163 FIXME("iface %p, override %p stub!\n", iface
, override
);
2168 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl
=
2170 d3drm_frame3_QueryInterface
,
2171 d3drm_frame3_AddRef
,
2172 d3drm_frame3_Release
,
2174 d3drm_frame3_AddDestroyCallback
,
2175 d3drm_frame3_DeleteDestroyCallback
,
2176 d3drm_frame3_SetAppData
,
2177 d3drm_frame3_GetAppData
,
2178 d3drm_frame3_SetName
,
2179 d3drm_frame3_GetName
,
2180 d3drm_frame3_GetClassName
,
2181 d3drm_frame3_AddChild
,
2182 d3drm_frame3_AddLight
,
2183 d3drm_frame3_AddMoveCallback
,
2184 d3drm_frame3_AddTransform
,
2185 d3drm_frame3_AddTranslation
,
2186 d3drm_frame3_AddScale
,
2187 d3drm_frame3_AddRotation
,
2188 d3drm_frame3_AddVisual
,
2189 d3drm_frame3_GetChildren
,
2190 d3drm_frame3_GetColor
,
2191 d3drm_frame3_GetLights
,
2192 d3drm_frame3_GetMaterialMode
,
2193 d3drm_frame3_GetParent
,
2194 d3drm_frame3_GetPosition
,
2195 d3drm_frame3_GetRotation
,
2196 d3drm_frame3_GetScene
,
2197 d3drm_frame3_GetSortMode
,
2198 d3drm_frame3_GetTexture
,
2199 d3drm_frame3_GetTransform
,
2200 d3drm_frame3_GetVelocity
,
2201 d3drm_frame3_GetOrientation
,
2202 d3drm_frame3_GetVisuals
,
2203 d3drm_frame3_InverseTransform
,
2205 d3drm_frame3_LookAt
,
2207 d3drm_frame3_DeleteChild
,
2208 d3drm_frame3_DeleteLight
,
2209 d3drm_frame3_DeleteMoveCallback
,
2210 d3drm_frame3_DeleteVisual
,
2211 d3drm_frame3_GetSceneBackground
,
2212 d3drm_frame3_GetSceneBackgroundDepth
,
2213 d3drm_frame3_GetSceneFogColor
,
2214 d3drm_frame3_GetSceneFogEnable
,
2215 d3drm_frame3_GetSceneFogMode
,
2216 d3drm_frame3_GetSceneFogParams
,
2217 d3drm_frame3_SetSceneBackground
,
2218 d3drm_frame3_SetSceneBackgroundRGB
,
2219 d3drm_frame3_SetSceneBackgroundDepth
,
2220 d3drm_frame3_SetSceneBackgroundImage
,
2221 d3drm_frame3_SetSceneFogEnable
,
2222 d3drm_frame3_SetSceneFogColor
,
2223 d3drm_frame3_SetSceneFogMode
,
2224 d3drm_frame3_SetSceneFogParams
,
2225 d3drm_frame3_SetColor
,
2226 d3drm_frame3_SetColorRGB
,
2227 d3drm_frame3_GetZbufferMode
,
2228 d3drm_frame3_SetMaterialMode
,
2229 d3drm_frame3_SetOrientation
,
2230 d3drm_frame3_SetPosition
,
2231 d3drm_frame3_SetRotation
,
2232 d3drm_frame3_SetSortMode
,
2233 d3drm_frame3_SetTexture
,
2234 d3drm_frame3_SetVelocity
,
2235 d3drm_frame3_SetZbufferMode
,
2236 d3drm_frame3_Transform
,
2237 d3drm_frame3_GetBox
,
2238 d3drm_frame3_GetBoxEnable
,
2239 d3drm_frame3_GetAxes
,
2240 d3drm_frame3_GetMaterial
,
2241 d3drm_frame3_GetInheritAxes
,
2242 d3drm_frame3_GetHierarchyBox
,
2243 d3drm_frame3_SetBox
,
2244 d3drm_frame3_SetBoxEnable
,
2245 d3drm_frame3_SetAxes
,
2246 d3drm_frame3_SetInheritAxes
,
2247 d3drm_frame3_SetMaterial
,
2248 d3drm_frame3_SetQuaternion
,
2249 d3drm_frame3_RayPick
,
2251 d3drm_frame3_TransformVectors
,
2252 d3drm_frame3_InverseTransformVectors
,
2253 d3drm_frame3_SetTraversalOptions
,
2254 d3drm_frame3_GetTraversalOptions
,
2255 d3drm_frame3_SetSceneFogMethod
,
2256 d3drm_frame3_GetSceneFogMethod
,
2257 d3drm_frame3_SetMaterialOverride
,
2258 d3drm_frame3_GetMaterialOverride
,
2261 static inline struct d3drm_frame
*unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3
*iface
)
2265 assert(iface
->lpVtbl
== &d3drm_frame3_vtbl
);
2267 return impl_from_IDirect3DRMFrame3(iface
);
2270 HRESULT
Direct3DRMFrame_create(REFIID riid
, IUnknown
*parent
, IUnknown
**out
)
2272 struct d3drm_frame
*object
;
2275 TRACE("riid %s, parent %p, out %p.\n", debugstr_guid(riid
), parent
, out
);
2277 if (!(object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
))))
2278 return E_OUTOFMEMORY
;
2280 object
->IDirect3DRMFrame2_iface
.lpVtbl
= &d3drm_frame2_vtbl
;
2281 object
->IDirect3DRMFrame3_iface
.lpVtbl
= &d3drm_frame3_vtbl
;
2283 object
->scenebackground
= RGBA_MAKE(0, 0, 0, 0xff);
2285 memcpy(object
->transform
, identity
, sizeof(D3DRMMATRIX4D
));
2289 IDirect3DRMFrame3
*p
;
2291 hr
= IDirect3DRMFrame_QueryInterface(parent
, &IID_IDirect3DRMFrame3
, (void**)&p
);
2294 HeapFree(GetProcessHeap(), 0, object
);
2297 IDirect3DRMFrame_Release(parent
);
2298 IDirect3DRMFrame3_AddChild(p
, &object
->IDirect3DRMFrame3_iface
);
2301 hr
= IDirect3DRMFrame3_QueryInterface(&object
->IDirect3DRMFrame3_iface
, riid
, (void **)out
);
2302 IDirect3DRMFrame3_Release(&object
->IDirect3DRMFrame3_iface
);