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(unsigned int frame_count
, IDirect3DRMFrame3
**frames
)
202 struct d3drm_frame_array
*array
;
205 if (!(array
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*array
))))
208 array
->IDirect3DRMFrameArray_iface
.lpVtbl
= &d3drm_frame_array_vtbl
;
210 array
->size
= frame_count
;
214 if (!(array
->frames
= HeapAlloc(GetProcessHeap(), 0, frame_count
* sizeof(*array
->frames
))))
216 HeapFree(GetProcessHeap(), 0, array
);
220 for (i
= 0; i
< frame_count
; ++i
)
222 IDirect3DRMFrame3_QueryInterface(frames
[i
], &IID_IDirect3DRMFrame
, (void **)&array
->frames
[i
]);
229 static HRESULT WINAPI
d3drm_visual_array_QueryInterface(IDirect3DRMVisualArray
*iface
, REFIID riid
, void **out
)
231 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
233 if (IsEqualGUID(riid
, &IID_IDirect3DRMVisualArray
)
234 || IsEqualGUID(riid
, &IID_IUnknown
))
236 IDirect3DRMVisualArray_AddRef(iface
);
241 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
244 return E_NOINTERFACE
;
247 static ULONG WINAPI
d3drm_visual_array_AddRef(IDirect3DRMVisualArray
*iface
)
249 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
250 ULONG refcount
= InterlockedIncrement(&array
->ref
);
252 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
257 static ULONG WINAPI
d3drm_visual_array_Release(IDirect3DRMVisualArray
*iface
)
259 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
260 ULONG refcount
= InterlockedDecrement(&array
->ref
);
263 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
267 for (i
= 0; i
< array
->size
; ++i
)
269 IDirect3DRMVisual_Release(array
->visuals
[i
]);
271 HeapFree(GetProcessHeap(), 0, array
->visuals
);
272 HeapFree(GetProcessHeap(), 0, array
);
278 static DWORD WINAPI
d3drm_visual_array_GetSize(IDirect3DRMVisualArray
*iface
)
280 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
282 TRACE("iface %p.\n", iface
);
287 static HRESULT WINAPI
d3drm_visual_array_GetElement(IDirect3DRMVisualArray
*iface
,
288 DWORD index
, IDirect3DRMVisual
**visual
)
290 struct d3drm_visual_array
*array
= impl_from_IDirect3DRMVisualArray(iface
);
292 TRACE("iface %p, index %u, visual %p.\n", iface
, index
, visual
);
295 return D3DRMERR_BADVALUE
;
297 if (index
>= array
->size
)
300 return D3DRMERR_BADVALUE
;
303 IDirect3DRMVisual_AddRef(array
->visuals
[index
]);
304 *visual
= array
->visuals
[index
];
309 static const struct IDirect3DRMVisualArrayVtbl d3drm_visual_array_vtbl
=
311 d3drm_visual_array_QueryInterface
,
312 d3drm_visual_array_AddRef
,
313 d3drm_visual_array_Release
,
314 d3drm_visual_array_GetSize
,
315 d3drm_visual_array_GetElement
,
318 static struct d3drm_visual_array
*d3drm_visual_array_create(unsigned int visual_count
, IDirect3DRMVisual
**visuals
)
320 struct d3drm_visual_array
*array
;
323 if (!(array
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*array
))))
326 array
->IDirect3DRMVisualArray_iface
.lpVtbl
= &d3drm_visual_array_vtbl
;
328 array
->size
= visual_count
;
332 if (!(array
->visuals
= HeapAlloc(GetProcessHeap(), 0, visual_count
* sizeof(*array
->visuals
))))
334 HeapFree(GetProcessHeap(), 0, array
);
338 for (i
= 0; i
< visual_count
; ++i
)
340 array
->visuals
[i
] = visuals
[i
];
341 IDirect3DRMVisual_AddRef(array
->visuals
[i
]);
348 static HRESULT WINAPI
d3drm_light_array_QueryInterface(IDirect3DRMLightArray
*iface
, REFIID riid
, void **out
)
350 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
352 if (IsEqualGUID(riid
, &IID_IDirect3DRMLightArray
)
353 || IsEqualGUID(riid
, &IID_IUnknown
))
355 IDirect3DRMLightArray_AddRef(iface
);
360 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
363 return E_NOINTERFACE
;
366 static ULONG WINAPI
d3drm_light_array_AddRef(IDirect3DRMLightArray
*iface
)
368 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
369 ULONG refcount
= InterlockedIncrement(&array
->ref
);
371 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
376 static ULONG WINAPI
d3drm_light_array_Release(IDirect3DRMLightArray
*iface
)
378 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
379 ULONG refcount
= InterlockedDecrement(&array
->ref
);
382 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
386 for (i
= 0; i
< array
->size
; ++i
)
388 IDirect3DRMLight_Release(array
->lights
[i
]);
390 HeapFree(GetProcessHeap(), 0, array
->lights
);
391 HeapFree(GetProcessHeap(), 0, array
);
397 static DWORD WINAPI
d3drm_light_array_GetSize(IDirect3DRMLightArray
*iface
)
399 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
401 TRACE("iface %p.\n", iface
);
406 static HRESULT WINAPI
d3drm_light_array_GetElement(IDirect3DRMLightArray
*iface
,
407 DWORD index
, IDirect3DRMLight
**light
)
409 struct d3drm_light_array
*array
= impl_from_IDirect3DRMLightArray(iface
);
411 TRACE("iface %p, index %u, light %p.\n", iface
, index
, light
);
414 return D3DRMERR_BADVALUE
;
416 if (index
>= array
->size
)
419 return D3DRMERR_BADVALUE
;
422 IDirect3DRMLight_AddRef(array
->lights
[index
]);
423 *light
= array
->lights
[index
];
428 static const struct IDirect3DRMLightArrayVtbl d3drm_light_array_vtbl
=
430 d3drm_light_array_QueryInterface
,
431 d3drm_light_array_AddRef
,
432 d3drm_light_array_Release
,
433 d3drm_light_array_GetSize
,
434 d3drm_light_array_GetElement
,
437 static struct d3drm_light_array
*d3drm_light_array_create(unsigned int light_count
, IDirect3DRMLight
**lights
)
439 struct d3drm_light_array
*array
;
442 if (!(array
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*array
))))
445 array
->IDirect3DRMLightArray_iface
.lpVtbl
= &d3drm_light_array_vtbl
;
447 array
->size
= light_count
;
451 if (!(array
->lights
= HeapAlloc(GetProcessHeap(), 0, light_count
* sizeof(*array
->lights
))))
453 HeapFree(GetProcessHeap(), 0, array
);
457 for (i
= 0; i
< light_count
; ++i
)
459 array
->lights
[i
] = lights
[i
];
460 IDirect3DRMLight_AddRef(array
->lights
[i
]);
467 static HRESULT WINAPI
d3drm_frame2_QueryInterface(IDirect3DRMFrame2
*iface
, REFIID riid
, void **out
)
469 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
471 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
473 if (IsEqualGUID(riid
, &IID_IDirect3DRMFrame2
)
474 || IsEqualGUID(riid
, &IID_IDirect3DRMFrame
)
475 || IsEqualGUID(riid
, &IID_IUnknown
))
477 *out
= &frame
->IDirect3DRMFrame2_iface
;
479 else if (IsEqualGUID(riid
, &IID_IDirect3DRMFrame3
))
481 *out
= &frame
->IDirect3DRMFrame3_iface
;
486 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid
));
487 return E_NOINTERFACE
;
490 IUnknown_AddRef((IUnknown
*)*out
);
494 static ULONG WINAPI
d3drm_frame2_AddRef(IDirect3DRMFrame2
*iface
)
496 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
497 ULONG refcount
= InterlockedIncrement(&frame
->ref
);
499 TRACE("%p increasing refcount to %u.\n", iface
, refcount
);
504 static ULONG WINAPI
d3drm_frame2_Release(IDirect3DRMFrame2
*iface
)
506 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
507 ULONG refcount
= InterlockedDecrement(&frame
->ref
);
510 TRACE("%p decreasing refcount to %u.\n", iface
, refcount
);
514 for (i
= 0; i
< frame
->nb_children
; ++i
)
516 IDirect3DRMFrame3_Release(frame
->children
[i
]);
518 HeapFree(GetProcessHeap(), 0, frame
->children
);
519 for (i
= 0; i
< frame
->nb_visuals
; ++i
)
521 IDirect3DRMVisual_Release(frame
->visuals
[i
]);
523 HeapFree(GetProcessHeap(), 0, frame
->visuals
);
524 for (i
= 0; i
< frame
->nb_lights
; ++i
)
526 IDirect3DRMLight_Release(frame
->lights
[i
]);
528 HeapFree(GetProcessHeap(), 0, frame
->lights
);
529 HeapFree(GetProcessHeap(), 0, frame
);
535 static HRESULT WINAPI
d3drm_frame2_Clone(IDirect3DRMFrame2
*iface
,
536 IUnknown
*outer
, REFIID iid
, void **out
)
538 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
543 static HRESULT WINAPI
d3drm_frame2_AddDestroyCallback(IDirect3DRMFrame2
*iface
,
544 D3DRMOBJECTCALLBACK cb
, void *ctx
)
546 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
551 static HRESULT WINAPI
d3drm_frame2_DeleteDestroyCallback(IDirect3DRMFrame2
*iface
,
552 D3DRMOBJECTCALLBACK cb
, void *ctx
)
554 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
559 static HRESULT WINAPI
d3drm_frame2_SetAppData(IDirect3DRMFrame2
*iface
, DWORD data
)
561 FIXME("iface %p, data %#x stub!\n", iface
, data
);
566 static DWORD WINAPI
d3drm_frame2_GetAppData(IDirect3DRMFrame2
*iface
)
568 FIXME("iface %p stub!\n", iface
);
573 static HRESULT WINAPI
d3drm_frame2_SetName(IDirect3DRMFrame2
*iface
, const char *name
)
575 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
580 static HRESULT WINAPI
d3drm_frame2_GetName(IDirect3DRMFrame2
*iface
, DWORD
*size
, char *name
)
582 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
587 static HRESULT WINAPI
d3drm_frame2_GetClassName(IDirect3DRMFrame2
*iface
, DWORD
*size
, char *name
)
589 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
591 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
593 return IDirect3DRMFrame3_GetClassName(&frame
->IDirect3DRMFrame3_iface
, size
, name
);
596 static HRESULT WINAPI
d3drm_frame2_AddChild(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*child
)
598 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
599 IDirect3DRMFrame3
*child3
;
602 TRACE("iface %p, child %p.\n", iface
, child
);
605 return D3DRMERR_BADOBJECT
;
606 hr
= IDirect3DRMFrame_QueryInterface(child
, &IID_IDirect3DRMFrame3
, (void **)&child3
);
608 return D3DRMERR_BADOBJECT
;
609 IDirect3DRMFrame_Release(child
);
611 return IDirect3DRMFrame3_AddChild(&frame
->IDirect3DRMFrame3_iface
, child3
);
614 static HRESULT WINAPI
d3drm_frame2_AddLight(IDirect3DRMFrame2
*iface
, IDirect3DRMLight
*light
)
616 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
618 TRACE("iface %p, light %p.\n", iface
, light
);
620 return IDirect3DRMFrame3_AddLight(&frame
->IDirect3DRMFrame3_iface
, light
);
623 static HRESULT WINAPI
d3drm_frame2_AddMoveCallback(IDirect3DRMFrame2
*iface
,
624 D3DRMFRAMEMOVECALLBACK cb
, void *ctx
)
626 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
631 static HRESULT WINAPI
d3drm_frame2_AddTransform(IDirect3DRMFrame2
*iface
, D3DRMCOMBINETYPE type
, D3DRMMATRIX4D matrix
)
633 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
635 TRACE("iface %p, type %#x, matrix %p.\n", iface
, type
, matrix
);
637 return IDirect3DRMFrame3_AddTransform(&frame
->IDirect3DRMFrame3_iface
, type
, matrix
);
640 static HRESULT WINAPI
d3drm_frame2_AddTranslation(IDirect3DRMFrame2
*iface
,
641 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
643 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface
, type
, x
, y
, z
);
648 static HRESULT WINAPI
d3drm_frame2_AddScale(IDirect3DRMFrame2
*iface
,
649 D3DRMCOMBINETYPE type
, D3DVALUE sx
, D3DVALUE sy
, D3DVALUE sz
)
651 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface
, type
, sx
, sy
, sz
);
656 static HRESULT WINAPI
d3drm_frame2_AddRotation(IDirect3DRMFrame2
*iface
,
657 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
659 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n", iface
, type
, x
, y
, z
, theta
);
664 static HRESULT WINAPI
d3drm_frame2_AddVisual(IDirect3DRMFrame2
*iface
, IDirect3DRMVisual
*visual
)
666 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
668 TRACE("iface %p, visual %p.\n", iface
, visual
);
670 return IDirect3DRMFrame3_AddVisual(&frame
->IDirect3DRMFrame3_iface
, (IUnknown
*)visual
);
673 static HRESULT WINAPI
d3drm_frame2_GetChildren(IDirect3DRMFrame2
*iface
, IDirect3DRMFrameArray
**children
)
675 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
677 TRACE("iface %p, children %p.\n", iface
, children
);
679 return IDirect3DRMFrame3_GetChildren(&frame
->IDirect3DRMFrame3_iface
, children
);
682 static D3DCOLOR WINAPI
d3drm_frame2_GetColor(IDirect3DRMFrame2
*iface
)
684 FIXME("iface %p stub!\n", iface
);
689 static HRESULT WINAPI
d3drm_frame2_GetLights(IDirect3DRMFrame2
*iface
, IDirect3DRMLightArray
**lights
)
691 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
693 TRACE("iface %p, lights %p.\n", iface
, lights
);
695 return IDirect3DRMFrame3_GetLights(&frame
->IDirect3DRMFrame3_iface
, lights
);
698 static D3DRMMATERIALMODE WINAPI
d3drm_frame2_GetMaterialMode(IDirect3DRMFrame2
*iface
)
700 FIXME("iface %p stub!\n", iface
);
702 return D3DRMMATERIAL_FROMPARENT
;
705 static HRESULT WINAPI
d3drm_frame2_GetParent(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
**parent
)
707 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
709 TRACE("iface %p, parent %p.\n", iface
, parent
);
712 return D3DRMERR_BADVALUE
;
716 *parent
= (IDirect3DRMFrame
*)&frame
->parent
->IDirect3DRMFrame2_iface
;
717 IDirect3DRMFrame_AddRef(*parent
);
727 static HRESULT WINAPI
d3drm_frame2_GetPosition(IDirect3DRMFrame2
*iface
,
728 IDirect3DRMFrame
*reference
, D3DVECTOR
*position
)
730 FIXME("iface %p, reference %p, position %p stub!\n", iface
, reference
, position
);
735 static HRESULT WINAPI
d3drm_frame2_GetRotation(IDirect3DRMFrame2
*iface
,
736 IDirect3DRMFrame
*reference
, D3DVECTOR
*axis
, D3DVALUE
*theta
)
738 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface
, reference
, axis
, theta
);
743 static HRESULT WINAPI
d3drm_frame2_GetScene(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
**scene
)
745 FIXME("iface %p, scene %p stub!\n", iface
, scene
);
750 static D3DRMSORTMODE WINAPI
d3drm_frame2_GetSortMode(IDirect3DRMFrame2
*iface
)
752 FIXME("iface %p stub!\n", iface
);
754 return D3DRMSORT_FROMPARENT
;
757 static HRESULT WINAPI
d3drm_frame2_GetTexture(IDirect3DRMFrame2
*iface
, IDirect3DRMTexture
**texture
)
759 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
764 static HRESULT WINAPI
d3drm_frame2_GetTransform(IDirect3DRMFrame2
*iface
, D3DRMMATRIX4D matrix
)
766 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
768 TRACE("iface %p, matrix %p.\n", iface
, matrix
);
770 memcpy(matrix
, frame
->transform
, sizeof(D3DRMMATRIX4D
));
775 static HRESULT WINAPI
d3drm_frame2_GetVelocity(IDirect3DRMFrame2
*iface
,
776 IDirect3DRMFrame
*reference
, D3DVECTOR
*velocity
, BOOL with_rotation
)
778 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
779 iface
, reference
, velocity
, with_rotation
);
784 static HRESULT WINAPI
d3drm_frame2_GetOrientation(IDirect3DRMFrame2
*iface
,
785 IDirect3DRMFrame
*reference
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
787 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface
, reference
, dir
, up
);
792 static HRESULT WINAPI
d3drm_frame2_GetVisuals(IDirect3DRMFrame2
*iface
, IDirect3DRMVisualArray
**visuals
)
794 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
795 struct d3drm_visual_array
*array
;
797 TRACE("iface %p, visuals %p.\n", iface
, visuals
);
800 return D3DRMERR_BADVALUE
;
802 if (!(array
= d3drm_visual_array_create(frame
->nb_visuals
, frame
->visuals
)))
803 return E_OUTOFMEMORY
;
805 *visuals
= &array
->IDirect3DRMVisualArray_iface
;
810 static HRESULT WINAPI
d3drm_frame2_GetTextureTopology(IDirect3DRMFrame2
*iface
, BOOL
*wrap_u
, BOOL
*wrap_v
)
812 FIXME("iface %p, wrap_u %p, wrap_v %p stub!\n", iface
, wrap_u
, wrap_v
);
817 static HRESULT WINAPI
d3drm_frame2_InverseTransform(IDirect3DRMFrame2
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
819 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
824 static HRESULT WINAPI
d3drm_frame2_Load(IDirect3DRMFrame2
*iface
, void *filename
,
825 void *name
, D3DRMLOADOPTIONS flags
, D3DRMLOADTEXTURECALLBACK cb
, void *ctx
)
827 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
828 iface
, filename
, name
, flags
, cb
, ctx
);
833 static HRESULT WINAPI
d3drm_frame2_LookAt(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*target
,
834 IDirect3DRMFrame
*reference
, D3DRMFRAMECONSTRAINT constraint
)
836 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface
, target
, reference
, constraint
);
841 static HRESULT WINAPI
d3drm_frame2_Move(IDirect3DRMFrame2
*iface
, D3DVALUE delta
)
843 FIXME("iface %p, delta %.8e stub!\n", iface
, delta
);
848 static HRESULT WINAPI
d3drm_frame2_DeleteChild(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*child
)
850 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
851 IDirect3DRMFrame3
*child3
;
854 TRACE("iface %p, child %p.\n", iface
, child
);
857 return D3DRMERR_BADOBJECT
;
858 if (FAILED(hr
= IDirect3DRMFrame_QueryInterface(child
, &IID_IDirect3DRMFrame3
, (void **)&child3
)))
859 return D3DRMERR_BADOBJECT
;
860 IDirect3DRMFrame_Release(child
);
862 return IDirect3DRMFrame3_DeleteChild(&frame
->IDirect3DRMFrame3_iface
, child3
);
865 static HRESULT WINAPI
d3drm_frame2_DeleteLight(IDirect3DRMFrame2
*iface
, IDirect3DRMLight
*light
)
867 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
869 TRACE("iface %p, light %p.\n", iface
, light
);
871 return IDirect3DRMFrame3_DeleteLight(&frame
->IDirect3DRMFrame3_iface
, light
);
874 static HRESULT WINAPI
d3drm_frame2_DeleteMoveCallback(IDirect3DRMFrame2
*iface
,
875 D3DRMFRAMEMOVECALLBACK cb
, void *ctx
)
877 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
882 static HRESULT WINAPI
d3drm_frame2_DeleteVisual(IDirect3DRMFrame2
*iface
, IDirect3DRMVisual
*visual
)
884 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
886 TRACE("iface %p, visual %p.\n", iface
, visual
);
888 return IDirect3DRMFrame3_DeleteVisual(&frame
->IDirect3DRMFrame3_iface
, (IUnknown
*)visual
);
891 static D3DCOLOR WINAPI
d3drm_frame2_GetSceneBackground(IDirect3DRMFrame2
*iface
)
893 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
895 TRACE("iface %p.\n", iface
);
897 return IDirect3DRMFrame3_GetSceneBackground(&frame
->IDirect3DRMFrame3_iface
);
900 static HRESULT WINAPI
d3drm_frame2_GetSceneBackgroundDepth(IDirect3DRMFrame2
*iface
,
901 IDirectDrawSurface
**surface
)
903 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
908 static D3DCOLOR WINAPI
d3drm_frame2_GetSceneFogColor(IDirect3DRMFrame2
*iface
)
910 FIXME("iface %p stub!\n", iface
);
915 static BOOL WINAPI
d3drm_frame2_GetSceneFogEnable(IDirect3DRMFrame2
*iface
)
917 FIXME("iface %p stub!\n", iface
);
922 static D3DRMFOGMODE WINAPI
d3drm_frame2_GetSceneFogMode(IDirect3DRMFrame2
*iface
)
924 FIXME("iface %p stub!\n", iface
);
926 return D3DRMFOG_LINEAR
;
929 static HRESULT WINAPI
d3drm_frame2_GetSceneFogParams(IDirect3DRMFrame2
*iface
,
930 D3DVALUE
*start
, D3DVALUE
*end
, D3DVALUE
*density
)
932 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface
, start
, end
, density
);
937 static HRESULT WINAPI
d3drm_frame2_SetSceneBackground(IDirect3DRMFrame2
*iface
, D3DCOLOR color
)
939 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
941 TRACE("iface %p, color 0x%08x.\n", iface
, color
);
943 return IDirect3DRMFrame3_SetSceneBackground(&frame
->IDirect3DRMFrame3_iface
, color
);
946 static HRESULT WINAPI
d3drm_frame2_SetSceneBackgroundRGB(IDirect3DRMFrame2
*iface
,
947 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
949 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame2(iface
);
951 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface
, red
, green
, blue
);
953 return IDirect3DRMFrame3_SetSceneBackgroundRGB(&frame
->IDirect3DRMFrame3_iface
, red
, green
, blue
);
956 static HRESULT WINAPI
d3drm_frame2_SetSceneBackgroundDepth(IDirect3DRMFrame2
*iface
, IDirectDrawSurface
*surface
)
958 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
963 static HRESULT WINAPI
d3drm_frame2_SetSceneBackgroundImage(IDirect3DRMFrame2
*iface
, IDirect3DRMTexture
*texture
)
965 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
970 static HRESULT WINAPI
d3drm_frame2_SetSceneFogEnable(IDirect3DRMFrame2
*iface
, BOOL enable
)
972 FIXME("iface %p, enable %#x stub!\n", iface
, enable
);
977 static HRESULT WINAPI
d3drm_frame2_SetSceneFogColor(IDirect3DRMFrame2
*iface
, D3DCOLOR color
)
979 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
984 static HRESULT WINAPI
d3drm_frame2_SetSceneFogMode(IDirect3DRMFrame2
*iface
, D3DRMFOGMODE mode
)
986 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
991 static HRESULT WINAPI
d3drm_frame2_SetSceneFogParams(IDirect3DRMFrame2
*iface
,
992 D3DVALUE start
, D3DVALUE end
, D3DVALUE density
)
994 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface
, start
, end
, density
);
999 static HRESULT WINAPI
d3drm_frame2_SetColor(IDirect3DRMFrame2
*iface
, D3DCOLOR color
)
1001 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
1006 static HRESULT WINAPI
d3drm_frame2_SetColorRGB(IDirect3DRMFrame2
*iface
,
1007 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
1009 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface
, red
, green
, blue
);
1014 static D3DRMZBUFFERMODE WINAPI
d3drm_frame2_GetZbufferMode(IDirect3DRMFrame2
*iface
)
1016 FIXME("iface %p stub!\n", iface
);
1018 return D3DRMZBUFFER_FROMPARENT
;
1021 static HRESULT WINAPI
d3drm_frame2_SetMaterialMode(IDirect3DRMFrame2
*iface
, D3DRMMATERIALMODE mode
)
1023 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1028 static HRESULT WINAPI
d3drm_frame2_SetOrientation(IDirect3DRMFrame2
*iface
, IDirect3DRMFrame
*reference
,
1029 D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
, D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
)
1031 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1032 iface
, reference
, dx
, dy
, dz
, ux
, uy
, uz
);
1037 static HRESULT WINAPI
d3drm_frame2_SetPosition(IDirect3DRMFrame2
*iface
,
1038 IDirect3DRMFrame
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
1040 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface
, reference
, x
, y
, z
);
1045 static HRESULT WINAPI
d3drm_frame2_SetRotation(IDirect3DRMFrame2
*iface
,
1046 IDirect3DRMFrame
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
1048 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1049 iface
, reference
, x
, y
, z
, theta
);
1054 static HRESULT WINAPI
d3drm_frame2_SetSortMode(IDirect3DRMFrame2
*iface
, D3DRMSORTMODE mode
)
1056 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1061 static HRESULT WINAPI
d3drm_frame2_SetTexture(IDirect3DRMFrame2
*iface
, IDirect3DRMTexture
*texture
)
1063 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1068 static HRESULT WINAPI
d3drm_frame2_SetTextureTopology(IDirect3DRMFrame2
*iface
, BOOL wrap_u
, BOOL wrap_v
)
1070 FIXME("iface %p, wrap_u %#x, wrap_v %#x stub!\n", iface
, wrap_u
, wrap_v
);
1075 static HRESULT WINAPI
d3drm_frame2_SetVelocity(IDirect3DRMFrame2
*iface
,
1076 IDirect3DRMFrame
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, BOOL with_rotation
)
1078 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x stub!\n",
1079 iface
, reference
, x
, y
, z
, with_rotation
);
1084 static HRESULT WINAPI
d3drm_frame2_SetZbufferMode(IDirect3DRMFrame2
*iface
, D3DRMZBUFFERMODE mode
)
1086 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1091 static HRESULT WINAPI
d3drm_frame2_Transform(IDirect3DRMFrame2
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
1093 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
1098 static HRESULT WINAPI
d3drm_frame2_AddMoveCallback2(IDirect3DRMFrame2
*iface
,
1099 D3DRMFRAMEMOVECALLBACK cb
, void *ctx
, DWORD flags
)
1101 FIXME("iface %p, cb %p, ctx %p, flags %#x stub!\n", iface
, cb
, ctx
, flags
);
1106 static HRESULT WINAPI
d3drm_frame2_GetBox(IDirect3DRMFrame2
*iface
, D3DRMBOX
*box
)
1108 FIXME("iface %p, box %p stub!\n", iface
, box
);
1113 static BOOL WINAPI
d3drm_frame2_GetBoxEnable(IDirect3DRMFrame2
*iface
)
1115 FIXME("iface %p stub!\n", iface
);
1120 static HRESULT WINAPI
d3drm_frame2_GetAxes(IDirect3DRMFrame2
*iface
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
1122 FIXME("iface %p, dir %p, up %p stub!\n", iface
, dir
, up
);
1127 static HRESULT WINAPI
d3drm_frame2_GetMaterial(IDirect3DRMFrame2
*iface
, IDirect3DRMMaterial
**material
)
1129 FIXME("iface %p, material %p stub!\n", iface
, material
);
1134 static BOOL WINAPI
d3drm_frame2_GetInheritAxes(IDirect3DRMFrame2
*iface
)
1136 FIXME("iface %p stub!\n", iface
);
1141 static HRESULT WINAPI
d3drm_frame2_GetHierarchyBox(IDirect3DRMFrame2
*iface
, D3DRMBOX
*box
)
1143 FIXME("iface %p, box %p stub!\n", iface
, box
);
1148 static const struct IDirect3DRMFrame2Vtbl d3drm_frame2_vtbl
=
1150 d3drm_frame2_QueryInterface
,
1151 d3drm_frame2_AddRef
,
1152 d3drm_frame2_Release
,
1154 d3drm_frame2_AddDestroyCallback
,
1155 d3drm_frame2_DeleteDestroyCallback
,
1156 d3drm_frame2_SetAppData
,
1157 d3drm_frame2_GetAppData
,
1158 d3drm_frame2_SetName
,
1159 d3drm_frame2_GetName
,
1160 d3drm_frame2_GetClassName
,
1161 d3drm_frame2_AddChild
,
1162 d3drm_frame2_AddLight
,
1163 d3drm_frame2_AddMoveCallback
,
1164 d3drm_frame2_AddTransform
,
1165 d3drm_frame2_AddTranslation
,
1166 d3drm_frame2_AddScale
,
1167 d3drm_frame2_AddRotation
,
1168 d3drm_frame2_AddVisual
,
1169 d3drm_frame2_GetChildren
,
1170 d3drm_frame2_GetColor
,
1171 d3drm_frame2_GetLights
,
1172 d3drm_frame2_GetMaterialMode
,
1173 d3drm_frame2_GetParent
,
1174 d3drm_frame2_GetPosition
,
1175 d3drm_frame2_GetRotation
,
1176 d3drm_frame2_GetScene
,
1177 d3drm_frame2_GetSortMode
,
1178 d3drm_frame2_GetTexture
,
1179 d3drm_frame2_GetTransform
,
1180 d3drm_frame2_GetVelocity
,
1181 d3drm_frame2_GetOrientation
,
1182 d3drm_frame2_GetVisuals
,
1183 d3drm_frame2_GetTextureTopology
,
1184 d3drm_frame2_InverseTransform
,
1186 d3drm_frame2_LookAt
,
1188 d3drm_frame2_DeleteChild
,
1189 d3drm_frame2_DeleteLight
,
1190 d3drm_frame2_DeleteMoveCallback
,
1191 d3drm_frame2_DeleteVisual
,
1192 d3drm_frame2_GetSceneBackground
,
1193 d3drm_frame2_GetSceneBackgroundDepth
,
1194 d3drm_frame2_GetSceneFogColor
,
1195 d3drm_frame2_GetSceneFogEnable
,
1196 d3drm_frame2_GetSceneFogMode
,
1197 d3drm_frame2_GetSceneFogParams
,
1198 d3drm_frame2_SetSceneBackground
,
1199 d3drm_frame2_SetSceneBackgroundRGB
,
1200 d3drm_frame2_SetSceneBackgroundDepth
,
1201 d3drm_frame2_SetSceneBackgroundImage
,
1202 d3drm_frame2_SetSceneFogEnable
,
1203 d3drm_frame2_SetSceneFogColor
,
1204 d3drm_frame2_SetSceneFogMode
,
1205 d3drm_frame2_SetSceneFogParams
,
1206 d3drm_frame2_SetColor
,
1207 d3drm_frame2_SetColorRGB
,
1208 d3drm_frame2_GetZbufferMode
,
1209 d3drm_frame2_SetMaterialMode
,
1210 d3drm_frame2_SetOrientation
,
1211 d3drm_frame2_SetPosition
,
1212 d3drm_frame2_SetRotation
,
1213 d3drm_frame2_SetSortMode
,
1214 d3drm_frame2_SetTexture
,
1215 d3drm_frame2_SetTextureTopology
,
1216 d3drm_frame2_SetVelocity
,
1217 d3drm_frame2_SetZbufferMode
,
1218 d3drm_frame2_Transform
,
1219 d3drm_frame2_AddMoveCallback2
,
1220 d3drm_frame2_GetBox
,
1221 d3drm_frame2_GetBoxEnable
,
1222 d3drm_frame2_GetAxes
,
1223 d3drm_frame2_GetMaterial
,
1224 d3drm_frame2_GetInheritAxes
,
1225 d3drm_frame2_GetHierarchyBox
,
1228 static HRESULT WINAPI
d3drm_frame3_QueryInterface(IDirect3DRMFrame3
*iface
, REFIID riid
, void **out
)
1230 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1232 TRACE("iface %p, riid %s, out %p.\n", iface
, debugstr_guid(riid
), out
);
1234 return d3drm_frame2_QueryInterface(&frame
->IDirect3DRMFrame2_iface
, riid
, out
);
1237 static ULONG WINAPI
d3drm_frame3_AddRef(IDirect3DRMFrame3
*iface
)
1239 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1241 TRACE("iface %p.\n", iface
);
1243 return d3drm_frame2_AddRef(&frame
->IDirect3DRMFrame2_iface
);
1246 static ULONG WINAPI
d3drm_frame3_Release(IDirect3DRMFrame3
*iface
)
1248 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1250 TRACE("iface %p.\n", iface
);
1252 return d3drm_frame2_Release(&frame
->IDirect3DRMFrame2_iface
);
1255 static HRESULT WINAPI
d3drm_frame3_Clone(IDirect3DRMFrame3
*iface
,
1256 IUnknown
*outer
, REFIID iid
, void **out
)
1258 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface
, outer
, debugstr_guid(iid
), out
);
1263 static HRESULT WINAPI
d3drm_frame3_AddDestroyCallback(IDirect3DRMFrame3
*iface
,
1264 D3DRMOBJECTCALLBACK cb
, void *ctx
)
1266 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1271 static HRESULT WINAPI
d3drm_frame3_DeleteDestroyCallback(IDirect3DRMFrame3
*iface
,
1272 D3DRMOBJECTCALLBACK cb
, void *ctx
)
1274 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1279 static HRESULT WINAPI
d3drm_frame3_SetAppData(IDirect3DRMFrame3
*iface
, DWORD data
)
1281 FIXME("iface %p, data %#x stub!\n", iface
, data
);
1286 static DWORD WINAPI
d3drm_frame3_GetAppData(IDirect3DRMFrame3
*iface
)
1288 FIXME("iface %p stub!\n", iface
);
1293 static HRESULT WINAPI
d3drm_frame3_SetName(IDirect3DRMFrame3
*iface
, const char *name
)
1295 FIXME("iface %p, name %s stub!\n", iface
, debugstr_a(name
));
1300 static HRESULT WINAPI
d3drm_frame3_GetName(IDirect3DRMFrame3
*iface
, DWORD
*size
, char *name
)
1302 FIXME("iface %p, size %p, name %p stub!\n", iface
, size
, name
);
1307 static HRESULT WINAPI
d3drm_frame3_GetClassName(IDirect3DRMFrame3
*iface
, DWORD
*size
, char *name
)
1309 TRACE("iface %p, size %p, name %p.\n", iface
, size
, name
);
1311 if (!size
|| *size
< strlen("Frame") || !name
)
1312 return E_INVALIDARG
;
1314 strcpy(name
, "Frame");
1315 *size
= sizeof("Frame");
1320 static HRESULT WINAPI
d3drm_frame3_AddChild(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*child
)
1322 struct d3drm_frame
*This
= impl_from_IDirect3DRMFrame3(iface
);
1323 struct d3drm_frame
*child_obj
= unsafe_impl_from_IDirect3DRMFrame3(child
);
1325 TRACE("iface %p, child %p.\n", iface
, child
);
1328 return D3DRMERR_BADOBJECT
;
1330 if (child_obj
->parent
)
1332 IDirect3DRMFrame3
* parent
= &child_obj
->parent
->IDirect3DRMFrame3_iface
;
1334 if (parent
== iface
)
1336 /* Passed frame is already a child so return success */
1341 /* Remove parent and continue */
1342 IDirect3DRMFrame3_DeleteChild(parent
, child
);
1346 if ((This
->nb_children
+ 1) > This
->children_capacity
)
1349 IDirect3DRMFrame3
** children
;
1351 if (!This
->children_capacity
)
1354 children
= HeapAlloc(GetProcessHeap(), 0, new_capacity
* sizeof(IDirect3DRMFrame3
*));
1358 new_capacity
= This
->children_capacity
* 2;
1359 children
= HeapReAlloc(GetProcessHeap(), 0, This
->children
, new_capacity
* sizeof(IDirect3DRMFrame3
*));
1363 return E_OUTOFMEMORY
;
1365 This
->children_capacity
= new_capacity
;
1366 This
->children
= children
;
1369 This
->children
[This
->nb_children
++] = child
;
1370 IDirect3DRMFrame3_AddRef(child
);
1371 child_obj
->parent
= This
;
1376 static HRESULT WINAPI
d3drm_frame3_AddLight(IDirect3DRMFrame3
*iface
, IDirect3DRMLight
*light
)
1378 struct d3drm_frame
*This
= impl_from_IDirect3DRMFrame3(iface
);
1380 IDirect3DRMLight
** lights
;
1382 TRACE("iface %p, light %p.\n", iface
, light
);
1385 return D3DRMERR_BADOBJECT
;
1387 /* Check if already existing and return gracefully without increasing ref count */
1388 for (i
= 0; i
< This
->nb_lights
; i
++)
1389 if (This
->lights
[i
] == light
)
1392 if ((This
->nb_lights
+ 1) > This
->lights_capacity
)
1396 if (!This
->lights_capacity
)
1399 lights
= HeapAlloc(GetProcessHeap(), 0, new_capacity
* sizeof(IDirect3DRMLight
*));
1403 new_capacity
= This
->lights_capacity
* 2;
1404 lights
= HeapReAlloc(GetProcessHeap(), 0, This
->lights
, new_capacity
* sizeof(IDirect3DRMLight
*));
1408 return E_OUTOFMEMORY
;
1410 This
->lights_capacity
= new_capacity
;
1411 This
->lights
= lights
;
1414 This
->lights
[This
->nb_lights
++] = light
;
1415 IDirect3DRMLight_AddRef(light
);
1420 static HRESULT WINAPI
d3drm_frame3_AddMoveCallback(IDirect3DRMFrame3
*iface
,
1421 D3DRMFRAME3MOVECALLBACK cb
, void *ctx
, DWORD flags
)
1423 FIXME("iface %p, cb %p, ctx %p flags %#x stub!\n", iface
, cb
, ctx
, flags
);
1428 static HRESULT WINAPI
d3drm_frame3_AddTransform(IDirect3DRMFrame3
*iface
,
1429 D3DRMCOMBINETYPE type
, D3DRMMATRIX4D matrix
)
1431 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1433 TRACE("iface %p, type %#x, matrix %p.\n", iface
, type
, matrix
);
1437 case D3DRMCOMBINE_REPLACE
:
1438 memcpy(frame
->transform
, matrix
, sizeof(D3DRMMATRIX4D
));
1441 case D3DRMCOMBINE_BEFORE
:
1442 FIXME("D3DRMCOMBINE_BEFORE not supported yet\n");
1445 case D3DRMCOMBINE_AFTER
:
1446 FIXME("D3DRMCOMBINE_AFTER not supported yet\n");
1450 WARN("Unknown Combine Type %u\n", type
);
1451 return D3DRMERR_BADVALUE
;
1457 static HRESULT WINAPI
d3drm_frame3_AddTranslation(IDirect3DRMFrame3
*iface
,
1458 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
1460 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e stub!\n", iface
, type
, x
, y
, z
);
1465 static HRESULT WINAPI
d3drm_frame3_AddScale(IDirect3DRMFrame3
*iface
,
1466 D3DRMCOMBINETYPE type
, D3DVALUE sx
, D3DVALUE sy
, D3DVALUE sz
)
1468 FIXME("iface %p, type %#x, sx %.8e, sy %.8e, sz %.8e stub!\n", iface
, type
, sx
, sy
, sz
);
1473 static HRESULT WINAPI
d3drm_frame3_AddRotation(IDirect3DRMFrame3
*iface
,
1474 D3DRMCOMBINETYPE type
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
1476 FIXME("iface %p, type %#x, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1477 iface
, type
, x
, y
, z
, theta
);
1482 static HRESULT WINAPI
d3drm_frame3_AddVisual(IDirect3DRMFrame3
*iface
, IUnknown
*visual
)
1484 struct d3drm_frame
*This
= impl_from_IDirect3DRMFrame3(iface
);
1486 IDirect3DRMVisual
** visuals
;
1488 TRACE("iface %p, visual %p.\n", iface
, visual
);
1491 return D3DRMERR_BADOBJECT
;
1493 /* Check if already existing and return gracefully without increasing ref count */
1494 for (i
= 0; i
< This
->nb_visuals
; i
++)
1495 if (This
->visuals
[i
] == (IDirect3DRMVisual
*)visual
)
1498 if ((This
->nb_visuals
+ 1) > This
->visuals_capacity
)
1502 if (!This
->visuals_capacity
)
1505 visuals
= HeapAlloc(GetProcessHeap(), 0, new_capacity
* sizeof(IDirect3DRMVisual
*));
1509 new_capacity
= This
->visuals_capacity
* 2;
1510 visuals
= HeapReAlloc(GetProcessHeap(), 0, This
->visuals
, new_capacity
* sizeof(IDirect3DRMVisual
*));
1514 return E_OUTOFMEMORY
;
1516 This
->visuals_capacity
= new_capacity
;
1517 This
->visuals
= visuals
;
1520 This
->visuals
[This
->nb_visuals
++] = (IDirect3DRMVisual
*)visual
;
1521 IDirect3DRMVisual_AddRef(visual
);
1526 static HRESULT WINAPI
d3drm_frame3_GetChildren(IDirect3DRMFrame3
*iface
, IDirect3DRMFrameArray
**children
)
1528 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1529 struct d3drm_frame_array
*array
;
1531 TRACE("iface %p, children %p.\n", iface
, children
);
1534 return D3DRMERR_BADVALUE
;
1536 if (!(array
= d3drm_frame_array_create(frame
->nb_children
, frame
->children
)))
1537 return E_OUTOFMEMORY
;
1539 *children
= &array
->IDirect3DRMFrameArray_iface
;
1544 static D3DCOLOR WINAPI
d3drm_frame3_GetColor(IDirect3DRMFrame3
*iface
)
1546 FIXME("iface %p stub!\n", iface
);
1551 static HRESULT WINAPI
d3drm_frame3_GetLights(IDirect3DRMFrame3
*iface
, IDirect3DRMLightArray
**lights
)
1553 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1554 struct d3drm_light_array
*array
;
1556 TRACE("iface %p, lights %p.\n", iface
, lights
);
1559 return D3DRMERR_BADVALUE
;
1561 if (!(array
= d3drm_light_array_create(frame
->nb_lights
, frame
->lights
)))
1562 return E_OUTOFMEMORY
;
1564 *lights
= &array
->IDirect3DRMLightArray_iface
;
1569 static D3DRMMATERIALMODE WINAPI
d3drm_frame3_GetMaterialMode(IDirect3DRMFrame3
*iface
)
1571 FIXME("iface %p stub!\n", iface
);
1573 return D3DRMMATERIAL_FROMPARENT
;
1576 static HRESULT WINAPI
d3drm_frame3_GetParent(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
**parent
)
1578 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1580 TRACE("iface %p, parent %p.\n", iface
, parent
);
1583 return D3DRMERR_BADVALUE
;
1587 *parent
= &frame
->parent
->IDirect3DRMFrame3_iface
;
1588 IDirect3DRMFrame_AddRef(*parent
);
1598 static HRESULT WINAPI
d3drm_frame3_GetPosition(IDirect3DRMFrame3
*iface
,
1599 IDirect3DRMFrame3
*reference
, D3DVECTOR
*position
)
1601 FIXME("iface %p, reference %p, position %p stub!\n", iface
, reference
, position
);
1606 static HRESULT WINAPI
d3drm_frame3_GetRotation(IDirect3DRMFrame3
*iface
,
1607 IDirect3DRMFrame3
*reference
, D3DVECTOR
*axis
, D3DVALUE
*theta
)
1609 FIXME("iface %p, reference %p, axis %p, theta %p stub!\n", iface
, reference
, axis
, theta
);
1614 static HRESULT WINAPI
d3drm_frame3_GetScene(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
**scene
)
1616 FIXME("iface %p, scene %p stub!\n", iface
, scene
);
1621 static D3DRMSORTMODE WINAPI
d3drm_frame3_GetSortMode(IDirect3DRMFrame3
*iface
)
1623 FIXME("iface %p stub!\n", iface
);
1625 return D3DRMSORT_FROMPARENT
;
1628 static HRESULT WINAPI
d3drm_frame3_GetTexture(IDirect3DRMFrame3
*iface
, IDirect3DRMTexture3
**texture
)
1630 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1635 static HRESULT WINAPI
d3drm_frame3_GetTransform(IDirect3DRMFrame3
*iface
,
1636 IDirect3DRMFrame3
*reference
, D3DRMMATRIX4D matrix
)
1638 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1640 TRACE("iface %p, reference %p, matrix %p.\n", iface
, reference
, matrix
);
1643 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1645 memcpy(matrix
, frame
->transform
, sizeof(D3DRMMATRIX4D
));
1650 static HRESULT WINAPI
d3drm_frame3_GetVelocity(IDirect3DRMFrame3
*iface
,
1651 IDirect3DRMFrame3
*reference
, D3DVECTOR
*velocity
, BOOL with_rotation
)
1653 FIXME("iface %p, reference %p, velocity %p, with_rotation %#x stub!\n",
1654 iface
, reference
, velocity
, with_rotation
);
1659 static HRESULT WINAPI
d3drm_frame3_GetOrientation(IDirect3DRMFrame3
*iface
,
1660 IDirect3DRMFrame3
*reference
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
1662 FIXME("iface %p, reference %p, dir %p, up %p stub!\n", iface
, reference
, dir
, up
);
1667 static HRESULT WINAPI
d3drm_frame3_GetVisuals(IDirect3DRMFrame3
*iface
,
1668 DWORD
*count
, IUnknown
**visuals
)
1670 FIXME("iface %p, count %p, visuals %p stub!\n", iface
, count
, visuals
);
1675 static HRESULT WINAPI
d3drm_frame3_InverseTransform(IDirect3DRMFrame3
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
1677 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
1682 static HRESULT WINAPI
d3drm_frame3_Load(IDirect3DRMFrame3
*iface
, void *filename
,
1683 void *name
, D3DRMLOADOPTIONS flags
, D3DRMLOADTEXTURE3CALLBACK cb
, void *ctx
)
1685 FIXME("iface %p, filename %p, name %p, flags %#x, cb %p, ctx %p stub!\n",
1686 iface
, filename
, name
, flags
, cb
, ctx
);
1691 static HRESULT WINAPI
d3drm_frame3_LookAt(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*target
,
1692 IDirect3DRMFrame3
*reference
, D3DRMFRAMECONSTRAINT constraint
)
1694 FIXME("iface %p, target %p, reference %p, constraint %#x stub!\n", iface
, target
, reference
, constraint
);
1699 static HRESULT WINAPI
d3drm_frame3_Move(IDirect3DRMFrame3
*iface
, D3DVALUE delta
)
1701 FIXME("iface %p, delta %.8e stub!\n", iface
, delta
);
1706 static HRESULT WINAPI
d3drm_frame3_DeleteChild(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*child
)
1708 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1709 struct d3drm_frame
*child_impl
= unsafe_impl_from_IDirect3DRMFrame3(child
);
1712 TRACE("iface %p, child %p.\n", iface
, child
);
1715 return D3DRMERR_BADOBJECT
;
1717 /* Check if child exists */
1718 for (i
= 0; i
< frame
->nb_children
; ++i
)
1720 if (frame
->children
[i
] == child
)
1724 if (i
== frame
->nb_children
)
1725 return D3DRMERR_BADVALUE
;
1727 memmove(frame
->children
+ i
, frame
->children
+ i
+ 1, sizeof(*frame
->children
) * (frame
->nb_children
- 1 - i
));
1728 IDirect3DRMFrame3_Release(child
);
1729 child_impl
->parent
= NULL
;
1730 --frame
->nb_children
;
1735 static HRESULT WINAPI
d3drm_frame3_DeleteLight(IDirect3DRMFrame3
*iface
, IDirect3DRMLight
*light
)
1737 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1740 TRACE("iface %p, light %p.\n", iface
, light
);
1743 return D3DRMERR_BADOBJECT
;
1745 /* Check if visual exists */
1746 for (i
= 0; i
< frame
->nb_lights
; ++i
)
1748 if (frame
->lights
[i
] == light
)
1752 if (i
== frame
->nb_lights
)
1753 return D3DRMERR_BADVALUE
;
1755 memmove(frame
->lights
+ i
, frame
->lights
+ i
+ 1, sizeof(*frame
->lights
) * (frame
->nb_lights
- 1 - i
));
1756 IDirect3DRMLight_Release(light
);
1762 static HRESULT WINAPI
d3drm_frame3_DeleteMoveCallback(IDirect3DRMFrame3
*iface
,
1763 D3DRMFRAME3MOVECALLBACK cb
, void *ctx
)
1765 FIXME("iface %p, cb %p, ctx %p stub!\n", iface
, cb
, ctx
);
1770 static HRESULT WINAPI
d3drm_frame3_DeleteVisual(IDirect3DRMFrame3
*iface
, IUnknown
*visual
)
1772 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1775 TRACE("iface %p, visual %p.\n", iface
, visual
);
1778 return D3DRMERR_BADOBJECT
;
1780 /* Check if visual exists */
1781 for (i
= 0; i
< frame
->nb_visuals
; ++i
)
1783 if (frame
->visuals
[i
] == (IDirect3DRMVisual
*)visual
)
1787 if (i
== frame
->nb_visuals
)
1788 return D3DRMERR_BADVALUE
;
1790 memmove(frame
->visuals
+ i
, frame
->visuals
+ i
+ 1, sizeof(*frame
->visuals
) * (frame
->nb_visuals
- 1 - i
));
1791 IDirect3DRMVisual_Release(visual
);
1792 --frame
->nb_visuals
;
1797 static D3DCOLOR WINAPI
d3drm_frame3_GetSceneBackground(IDirect3DRMFrame3
*iface
)
1799 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1801 TRACE("iface %p.\n", iface
);
1803 return frame
->scenebackground
;
1806 static HRESULT WINAPI
d3drm_frame3_GetSceneBackgroundDepth(IDirect3DRMFrame3
*iface
,
1807 IDirectDrawSurface
**surface
)
1809 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
1814 static D3DCOLOR WINAPI
d3drm_frame3_GetSceneFogColor(IDirect3DRMFrame3
*iface
)
1816 FIXME("iface %p stub!\n", iface
);
1821 static BOOL WINAPI
d3drm_frame3_GetSceneFogEnable(IDirect3DRMFrame3
*iface
)
1823 FIXME("iface %p stub!\n", iface
);
1828 static D3DRMFOGMODE WINAPI
d3drm_frame3_GetSceneFogMode(IDirect3DRMFrame3
*iface
)
1830 FIXME("iface %p stub!\n", iface
);
1832 return D3DRMFOG_LINEAR
;
1835 static HRESULT WINAPI
d3drm_frame3_GetSceneFogParams(IDirect3DRMFrame3
*iface
,
1836 D3DVALUE
*start
, D3DVALUE
*end
, D3DVALUE
*density
)
1838 FIXME("iface %p, start %p, end %p, density %p stub!\n", iface
, start
, end
, density
);
1843 static HRESULT WINAPI
d3drm_frame3_SetSceneBackground(IDirect3DRMFrame3
*iface
, D3DCOLOR color
)
1845 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1847 TRACE("iface %p, color 0x%08x.\n", iface
, color
);
1849 frame
->scenebackground
= color
;
1854 static HRESULT WINAPI
d3drm_frame3_SetSceneBackgroundRGB(IDirect3DRMFrame3
*iface
,
1855 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
1857 struct d3drm_frame
*frame
= impl_from_IDirect3DRMFrame3(iface
);
1859 TRACE("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface
, red
, green
, blue
);
1861 frame
->scenebackground
= RGBA_MAKE((BYTE
)(red
* 255.0f
),
1862 (BYTE
)(green
* 255.0f
), (BYTE
)(blue
* 255.0f
), 0xff);
1867 static HRESULT WINAPI
d3drm_frame3_SetSceneBackgroundDepth(IDirect3DRMFrame3
*iface
,
1868 IDirectDrawSurface
*surface
)
1870 FIXME("iface %p, surface %p stub!\n", iface
, surface
);
1875 static HRESULT WINAPI
d3drm_frame3_SetSceneBackgroundImage(IDirect3DRMFrame3
*iface
,
1876 IDirect3DRMTexture3
*texture
)
1878 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1883 static HRESULT WINAPI
d3drm_frame3_SetSceneFogEnable(IDirect3DRMFrame3
*iface
, BOOL enable
)
1885 FIXME("iface %p, enable %#x stub!\n", iface
, enable
);
1890 static HRESULT WINAPI
d3drm_frame3_SetSceneFogColor(IDirect3DRMFrame3
*iface
, D3DCOLOR color
)
1892 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
1897 static HRESULT WINAPI
d3drm_frame3_SetSceneFogMode(IDirect3DRMFrame3
*iface
, D3DRMFOGMODE mode
)
1899 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1904 static HRESULT WINAPI
d3drm_frame3_SetSceneFogParams(IDirect3DRMFrame3
*iface
,
1905 D3DVALUE start
, D3DVALUE end
, D3DVALUE density
)
1907 FIXME("iface %p, start %.8e, end %.8e, density %.8e stub!\n", iface
, start
, end
, density
);
1912 static HRESULT WINAPI
d3drm_frame3_SetColor(IDirect3DRMFrame3
*iface
, D3DCOLOR color
)
1914 FIXME("iface %p, color 0x%08x stub!\n", iface
, color
);
1919 static HRESULT WINAPI
d3drm_frame3_SetColorRGB(IDirect3DRMFrame3
*iface
,
1920 D3DVALUE red
, D3DVALUE green
, D3DVALUE blue
)
1922 FIXME("iface %p, red %.8e, green %.8e, blue %.8e stub!\n", iface
, red
, green
, blue
);
1927 static D3DRMZBUFFERMODE WINAPI
d3drm_frame3_GetZbufferMode(IDirect3DRMFrame3
*iface
)
1929 FIXME("iface %p stub!\n", iface
);
1931 return D3DRMZBUFFER_FROMPARENT
;
1934 static HRESULT WINAPI
d3drm_frame3_SetMaterialMode(IDirect3DRMFrame3
*iface
, D3DRMMATERIALMODE mode
)
1936 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1941 static HRESULT WINAPI
d3drm_frame3_SetOrientation(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*reference
,
1942 D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
, D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
)
1944 FIXME("iface %p, reference %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
1945 iface
, reference
, dx
, dy
, dz
, ux
, uy
, uz
);
1950 static HRESULT WINAPI
d3drm_frame3_SetPosition(IDirect3DRMFrame3
*iface
,
1951 IDirect3DRMFrame3
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
)
1953 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e stub!\n", iface
, reference
, x
, y
, z
);
1958 static HRESULT WINAPI
d3drm_frame3_SetRotation(IDirect3DRMFrame3
*iface
,
1959 IDirect3DRMFrame3
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, D3DVALUE theta
)
1961 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, theta %.8e stub!\n",
1962 iface
, reference
, x
, y
, z
, theta
);
1967 static HRESULT WINAPI
d3drm_frame3_SetSortMode(IDirect3DRMFrame3
*iface
, D3DRMSORTMODE mode
)
1969 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1974 static HRESULT WINAPI
d3drm_frame3_SetTexture(IDirect3DRMFrame3
*iface
, IDirect3DRMTexture3
*texture
)
1976 FIXME("iface %p, texture %p stub!\n", iface
, texture
);
1981 static HRESULT WINAPI
d3drm_frame3_SetVelocity(IDirect3DRMFrame3
*iface
,
1982 IDirect3DRMFrame3
*reference
, D3DVALUE x
, D3DVALUE y
, D3DVALUE z
, BOOL with_rotation
)
1984 FIXME("iface %p, reference %p, x %.8e, y %.8e, z %.8e, with_rotation %#x.\n",
1985 iface
, reference
, x
, y
, z
, with_rotation
);
1990 static HRESULT WINAPI
d3drm_frame3_SetZbufferMode(IDirect3DRMFrame3
*iface
, D3DRMZBUFFERMODE mode
)
1992 FIXME("iface %p, mode %#x stub!\n", iface
, mode
);
1997 static HRESULT WINAPI
d3drm_frame3_Transform(IDirect3DRMFrame3
*iface
, D3DVECTOR
*d
, D3DVECTOR
*s
)
1999 FIXME("iface %p, d %p, s %p stub!\n", iface
, d
, s
);
2004 static HRESULT WINAPI
d3drm_frame3_GetBox(IDirect3DRMFrame3
*iface
, D3DRMBOX
*box
)
2006 FIXME("iface %p, box %p stub!\n", iface
, box
);
2011 static BOOL WINAPI
d3drm_frame3_GetBoxEnable(IDirect3DRMFrame3
*iface
)
2013 FIXME("iface %p stub!\n", iface
);
2018 static HRESULT WINAPI
d3drm_frame3_GetAxes(IDirect3DRMFrame3
*iface
, D3DVECTOR
*dir
, D3DVECTOR
*up
)
2020 FIXME("iface %p, dir %p, up %p stub!\n", iface
, dir
, up
);
2025 static HRESULT WINAPI
d3drm_frame3_GetMaterial(IDirect3DRMFrame3
*iface
, IDirect3DRMMaterial2
**material
)
2027 FIXME("iface %p, material %p stub!\n", iface
, material
);
2032 static BOOL WINAPI
d3drm_frame3_GetInheritAxes(IDirect3DRMFrame3
*iface
)
2034 FIXME("iface %p stub!\n", iface
);
2039 static HRESULT WINAPI
d3drm_frame3_GetHierarchyBox(IDirect3DRMFrame3
*iface
, D3DRMBOX
*box
)
2041 FIXME("iface %p, box %p stub!\n", iface
, box
);
2046 static HRESULT WINAPI
d3drm_frame3_SetBox(IDirect3DRMFrame3
*iface
, D3DRMBOX
*box
)
2048 FIXME("iface %p, box %p stub!\n", iface
, box
);
2053 static HRESULT WINAPI
d3drm_frame3_SetBoxEnable(IDirect3DRMFrame3
*iface
, BOOL enable
)
2055 FIXME("iface %p, enable %#x stub!\n", iface
, enable
);
2060 static HRESULT WINAPI
d3drm_frame3_SetAxes(IDirect3DRMFrame3
*iface
,
2061 D3DVALUE dx
, D3DVALUE dy
, D3DVALUE dz
, D3DVALUE ux
, D3DVALUE uy
, D3DVALUE uz
)
2063 FIXME("iface %p, dx %.8e, dy %.8e, dz %.8e, ux %.8e, uy %.8e, uz %.8e stub!\n",
2064 iface
, dx
, dy
, dz
, ux
, uy
, uz
);
2069 static HRESULT WINAPI
d3drm_frame3_SetInheritAxes(IDirect3DRMFrame3
*iface
, BOOL inherit
)
2071 FIXME("iface %p, inherit %#x stub!\n", iface
, inherit
);
2076 static HRESULT WINAPI
d3drm_frame3_SetMaterial(IDirect3DRMFrame3
*iface
, IDirect3DRMMaterial2
*material
)
2078 FIXME("iface %p, material %p stub!\n", iface
, material
);
2083 static HRESULT WINAPI
d3drm_frame3_SetQuaternion(IDirect3DRMFrame3
*iface
,
2084 IDirect3DRMFrame3
*reference
, D3DRMQUATERNION
*q
)
2086 FIXME("iface %p, reference %p, q %p stub!\n", iface
, reference
, q
);
2091 static HRESULT WINAPI
d3drm_frame3_RayPick(IDirect3DRMFrame3
*iface
, IDirect3DRMFrame3
*reference
,
2092 D3DRMRAY
*ray
, DWORD flags
, IDirect3DRMPicked2Array
**visuals
)
2094 FIXME("iface %p, reference %p, ray %p, flags %#x, visuals %p stub!\n",
2095 iface
, reference
, ray
, flags
, visuals
);
2100 static HRESULT WINAPI
d3drm_frame3_Save(IDirect3DRMFrame3
*iface
,
2101 const char *filename
, D3DRMXOFFORMAT format
, D3DRMSAVEOPTIONS flags
)
2103 FIXME("iface %p, filename %s, format %#x, flags %#x stub!\n",
2104 iface
, debugstr_a(filename
), format
, flags
);
2109 static HRESULT WINAPI
d3drm_frame3_TransformVectors(IDirect3DRMFrame3
*iface
,
2110 IDirect3DRMFrame3
*reference
, DWORD num
, D3DVECTOR
*dst
, D3DVECTOR
*src
)
2112 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface
, reference
, num
, dst
, src
);
2117 static HRESULT WINAPI
d3drm_frame3_InverseTransformVectors(IDirect3DRMFrame3
*iface
,
2118 IDirect3DRMFrame3
*reference
, DWORD num
, D3DVECTOR
*dst
, D3DVECTOR
*src
)
2120 FIXME("iface %p, reference %p, num %u, dst %p, src %p stub!\n", iface
, reference
, num
, dst
, src
);
2125 static HRESULT WINAPI
d3drm_frame3_SetTraversalOptions(IDirect3DRMFrame3
*iface
, DWORD flags
)
2127 FIXME("iface %p, flags %#x stub!\n", iface
, flags
);
2132 static HRESULT WINAPI
d3drm_frame3_GetTraversalOptions(IDirect3DRMFrame3
*iface
, DWORD
*flags
)
2134 FIXME("iface %p, flags %p stub!\n", iface
, flags
);
2139 static HRESULT WINAPI
d3drm_frame3_SetSceneFogMethod(IDirect3DRMFrame3
*iface
, DWORD flags
)
2141 FIXME("iface %p, flags %#x stub!\n", iface
, flags
);
2146 static HRESULT WINAPI
d3drm_frame3_GetSceneFogMethod(IDirect3DRMFrame3
*iface
, DWORD
*fog_mode
)
2148 FIXME("iface %p, fog_mode %p stub!\n", iface
, fog_mode
);
2153 static HRESULT WINAPI
d3drm_frame3_SetMaterialOverride(IDirect3DRMFrame3
*iface
,
2154 D3DRMMATERIALOVERRIDE
*override
)
2156 FIXME("iface %p, override %p stub!\n", iface
, override
);
2161 static HRESULT WINAPI
d3drm_frame3_GetMaterialOverride(IDirect3DRMFrame3
*iface
,
2162 D3DRMMATERIALOVERRIDE
*override
)
2164 FIXME("iface %p, override %p stub!\n", iface
, override
);
2169 static const struct IDirect3DRMFrame3Vtbl d3drm_frame3_vtbl
=
2171 d3drm_frame3_QueryInterface
,
2172 d3drm_frame3_AddRef
,
2173 d3drm_frame3_Release
,
2175 d3drm_frame3_AddDestroyCallback
,
2176 d3drm_frame3_DeleteDestroyCallback
,
2177 d3drm_frame3_SetAppData
,
2178 d3drm_frame3_GetAppData
,
2179 d3drm_frame3_SetName
,
2180 d3drm_frame3_GetName
,
2181 d3drm_frame3_GetClassName
,
2182 d3drm_frame3_AddChild
,
2183 d3drm_frame3_AddLight
,
2184 d3drm_frame3_AddMoveCallback
,
2185 d3drm_frame3_AddTransform
,
2186 d3drm_frame3_AddTranslation
,
2187 d3drm_frame3_AddScale
,
2188 d3drm_frame3_AddRotation
,
2189 d3drm_frame3_AddVisual
,
2190 d3drm_frame3_GetChildren
,
2191 d3drm_frame3_GetColor
,
2192 d3drm_frame3_GetLights
,
2193 d3drm_frame3_GetMaterialMode
,
2194 d3drm_frame3_GetParent
,
2195 d3drm_frame3_GetPosition
,
2196 d3drm_frame3_GetRotation
,
2197 d3drm_frame3_GetScene
,
2198 d3drm_frame3_GetSortMode
,
2199 d3drm_frame3_GetTexture
,
2200 d3drm_frame3_GetTransform
,
2201 d3drm_frame3_GetVelocity
,
2202 d3drm_frame3_GetOrientation
,
2203 d3drm_frame3_GetVisuals
,
2204 d3drm_frame3_InverseTransform
,
2206 d3drm_frame3_LookAt
,
2208 d3drm_frame3_DeleteChild
,
2209 d3drm_frame3_DeleteLight
,
2210 d3drm_frame3_DeleteMoveCallback
,
2211 d3drm_frame3_DeleteVisual
,
2212 d3drm_frame3_GetSceneBackground
,
2213 d3drm_frame3_GetSceneBackgroundDepth
,
2214 d3drm_frame3_GetSceneFogColor
,
2215 d3drm_frame3_GetSceneFogEnable
,
2216 d3drm_frame3_GetSceneFogMode
,
2217 d3drm_frame3_GetSceneFogParams
,
2218 d3drm_frame3_SetSceneBackground
,
2219 d3drm_frame3_SetSceneBackgroundRGB
,
2220 d3drm_frame3_SetSceneBackgroundDepth
,
2221 d3drm_frame3_SetSceneBackgroundImage
,
2222 d3drm_frame3_SetSceneFogEnable
,
2223 d3drm_frame3_SetSceneFogColor
,
2224 d3drm_frame3_SetSceneFogMode
,
2225 d3drm_frame3_SetSceneFogParams
,
2226 d3drm_frame3_SetColor
,
2227 d3drm_frame3_SetColorRGB
,
2228 d3drm_frame3_GetZbufferMode
,
2229 d3drm_frame3_SetMaterialMode
,
2230 d3drm_frame3_SetOrientation
,
2231 d3drm_frame3_SetPosition
,
2232 d3drm_frame3_SetRotation
,
2233 d3drm_frame3_SetSortMode
,
2234 d3drm_frame3_SetTexture
,
2235 d3drm_frame3_SetVelocity
,
2236 d3drm_frame3_SetZbufferMode
,
2237 d3drm_frame3_Transform
,
2238 d3drm_frame3_GetBox
,
2239 d3drm_frame3_GetBoxEnable
,
2240 d3drm_frame3_GetAxes
,
2241 d3drm_frame3_GetMaterial
,
2242 d3drm_frame3_GetInheritAxes
,
2243 d3drm_frame3_GetHierarchyBox
,
2244 d3drm_frame3_SetBox
,
2245 d3drm_frame3_SetBoxEnable
,
2246 d3drm_frame3_SetAxes
,
2247 d3drm_frame3_SetInheritAxes
,
2248 d3drm_frame3_SetMaterial
,
2249 d3drm_frame3_SetQuaternion
,
2250 d3drm_frame3_RayPick
,
2252 d3drm_frame3_TransformVectors
,
2253 d3drm_frame3_InverseTransformVectors
,
2254 d3drm_frame3_SetTraversalOptions
,
2255 d3drm_frame3_GetTraversalOptions
,
2256 d3drm_frame3_SetSceneFogMethod
,
2257 d3drm_frame3_GetSceneFogMethod
,
2258 d3drm_frame3_SetMaterialOverride
,
2259 d3drm_frame3_GetMaterialOverride
,
2262 static inline struct d3drm_frame
*unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3
*iface
)
2266 assert(iface
->lpVtbl
== &d3drm_frame3_vtbl
);
2268 return impl_from_IDirect3DRMFrame3(iface
);
2271 HRESULT
Direct3DRMFrame_create(REFIID riid
, IUnknown
*parent
, IUnknown
**out
)
2273 struct d3drm_frame
*object
;
2276 TRACE("riid %s, parent %p, out %p.\n", debugstr_guid(riid
), parent
, out
);
2278 if (!(object
= HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, sizeof(*object
))))
2279 return E_OUTOFMEMORY
;
2281 object
->IDirect3DRMFrame2_iface
.lpVtbl
= &d3drm_frame2_vtbl
;
2282 object
->IDirect3DRMFrame3_iface
.lpVtbl
= &d3drm_frame3_vtbl
;
2284 object
->scenebackground
= RGBA_MAKE(0, 0, 0, 0xff);
2286 memcpy(object
->transform
, identity
, sizeof(D3DRMMATRIX4D
));
2290 IDirect3DRMFrame3
*p
;
2292 hr
= IDirect3DRMFrame_QueryInterface(parent
, &IID_IDirect3DRMFrame3
, (void**)&p
);
2295 HeapFree(GetProcessHeap(), 0, object
);
2298 IDirect3DRMFrame_Release(parent
);
2299 IDirect3DRMFrame3_AddChild(p
, &object
->IDirect3DRMFrame3_iface
);
2302 hr
= IDirect3DRMFrame3_QueryInterface(&object
->IDirect3DRMFrame3_iface
, riid
, (void **)out
);
2303 IDirect3DRMFrame3_Release(&object
->IDirect3DRMFrame3_iface
);