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 }
41 typedef struct IDirect3DRMFrameImpl IDirect3DRMFrameImpl;
43 struct IDirect3DRMFrameImpl {
44 IDirect3DRMFrame2 IDirect3DRMFrame2_iface;
45 IDirect3DRMFrame3 IDirect3DRMFrame3_iface;
47 IDirect3DRMFrameImpl* parent;
49 ULONG children_capacity;
50 IDirect3DRMFrame3** children;
52 ULONG visuals_capacity;
53 IDirect3DRMVisual** visuals;
55 ULONG lights_capacity;
56 IDirect3DRMLight** lights;
57 D3DRMMATRIX4D transform;
61 IDirect3DRMFrameArray IDirect3DRMFrameArray_iface;
64 LPDIRECT3DRMFRAME* frames;
65 } IDirect3DRMFrameArrayImpl;
68 IDirect3DRMVisualArray IDirect3DRMVisualArray_iface;
71 LPDIRECT3DRMVISUAL* visuals;
72 } IDirect3DRMVisualArrayImpl;
75 IDirect3DRMLightArray IDirect3DRMLightArray_iface;
78 LPDIRECT3DRMLIGHT* lights;
79 } IDirect3DRMLightArrayImpl;
81 HRESULT Direct3DRMFrameArray_create(IDirect3DRMFrameArray** obj);
82 HRESULT Direct3DRMVisualArray_create(IDirect3DRMVisualArray** ret_iface);
83 HRESULT Direct3DRMLightArray_create(IDirect3DRMLightArray** ret_iface);
85 static inline IDirect3DRMFrameImpl *impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
87 return CONTAINING_RECORD(iface, IDirect3DRMFrameImpl, IDirect3DRMFrame2_iface);
90 static inline IDirect3DRMFrameImpl *impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
92 return CONTAINING_RECORD(iface, IDirect3DRMFrameImpl, IDirect3DRMFrame3_iface);
95 static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface);
96 static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface);
98 static inline IDirect3DRMLightArrayImpl *impl_from_IDirect3DRMLightArray(IDirect3DRMLightArray *iface)
100 return CONTAINING_RECORD(iface, IDirect3DRMLightArrayImpl, IDirect3DRMLightArray_iface);
103 /*** IUnknown methods ***/
104 static HRESULT WINAPI IDirect3DRMFrame2Impl_QueryInterface(IDirect3DRMFrame2* iface,
105 REFIID riid, void** object)
107 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
109 TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
113 if(IsEqualGUID(riid, &IID_IUnknown) ||
114 IsEqualGUID(riid, &IID_IDirect3DRMFrame) ||
115 IsEqualGUID(riid, &IID_IDirect3DRMFrame2))
117 *object = &This->IDirect3DRMFrame2_iface;
119 else if(IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
121 *object = &This->IDirect3DRMFrame3_iface;
125 FIXME("interface %s not implemented\n", debugstr_guid(riid));
126 return E_NOINTERFACE;
129 IDirect3DRMFrame2_AddRef(iface);
133 static ULONG WINAPI IDirect3DRMFrame2Impl_AddRef(IDirect3DRMFrame2* iface)
135 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
136 ULONG ref = InterlockedIncrement(&This->ref);
138 TRACE("(%p)->(): new ref = %d\n", This, ref);
143 static ULONG WINAPI IDirect3DRMFrame2Impl_Release(IDirect3DRMFrame2* iface)
145 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
146 ULONG ref = InterlockedDecrement(&This->ref);
149 TRACE("(%p)->(): new ref = %d\n", This, ref);
153 for (i = 0; i < This->nb_children; i++)
154 IDirect3DRMFrame3_Release(This->children[i]);
155 HeapFree(GetProcessHeap(), 0, This->children);
156 for (i = 0; i < This->nb_visuals; i++)
157 IDirect3DRMVisual_Release(This->visuals[i]);
158 HeapFree(GetProcessHeap(), 0, This->visuals);
159 for (i = 0; i < This->nb_lights; i++)
160 IDirect3DRMLight_Release(This->lights[i]);
161 HeapFree(GetProcessHeap(), 0, This->lights);
162 HeapFree(GetProcessHeap(), 0, This);
168 /*** IDirect3DRMObject methods ***/
169 static HRESULT WINAPI IDirect3DRMFrame2Impl_Clone(IDirect3DRMFrame2* iface,
170 LPUNKNOWN unkwn, REFIID riid,
173 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
175 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
180 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddDestroyCallback(IDirect3DRMFrame2* iface,
181 D3DRMOBJECTCALLBACK cb,
184 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
186 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
191 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteDestroyCallback(IDirect3DRMFrame2* iface,
192 D3DRMOBJECTCALLBACK cb,
195 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
197 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
202 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetAppData(IDirect3DRMFrame2* iface,
205 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
207 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
212 static DWORD WINAPI IDirect3DRMFrame2Impl_GetAppData(IDirect3DRMFrame2* iface)
214 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
216 FIXME("(%p/%p)->(): stub\n", iface, This);
221 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetName(IDirect3DRMFrame2* iface, LPCSTR name)
223 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
225 FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
230 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetName(IDirect3DRMFrame2* iface,
231 LPDWORD size, LPSTR name)
233 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
235 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
240 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetClassName(IDirect3DRMFrame2* iface,
241 LPDWORD size, LPSTR name)
243 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
245 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
250 /*** IDirect3DRMFrame methods ***/
251 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddChild(IDirect3DRMFrame2* iface,
252 LPDIRECT3DRMFRAME child)
254 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
255 IDirect3DRMFrameImpl *frame = unsafe_impl_from_IDirect3DRMFrame2((LPDIRECT3DRMFRAME2)child);
257 TRACE("(%p/%p)->(%p)\n", iface, This, child);
260 return D3DRMERR_BADOBJECT;
262 return IDirect3DRMFrame3_AddChild(&This->IDirect3DRMFrame3_iface, &frame->IDirect3DRMFrame3_iface);
265 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddLight(IDirect3DRMFrame2* iface,
266 LPDIRECT3DRMLIGHT light)
268 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
270 TRACE("(%p/%p)->(%p)\n", iface, This, light);
272 return IDirect3DRMFrame3_AddLight(&This->IDirect3DRMFrame3_iface, light);
275 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddMoveCallback(IDirect3DRMFrame2* iface,
276 D3DRMFRAMEMOVECALLBACK cb, VOID *arg)
278 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
280 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
285 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddTransform(IDirect3DRMFrame2* iface,
286 D3DRMCOMBINETYPE type,
287 D3DRMMATRIX4D matrix)
289 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
291 TRACE("(%p/%p)->(%u,%p)\n", iface, This, type, matrix);
293 return IDirect3DRMFrame3_AddTransform(&This->IDirect3DRMFrame3_iface, type, matrix);
296 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddTranslation(IDirect3DRMFrame2* iface,
297 D3DRMCOMBINETYPE type,
298 D3DVALUE x, D3DVALUE y, D3DVALUE z)
300 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
302 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, x, y, z);
307 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddScale(IDirect3DRMFrame2* iface,
308 D3DRMCOMBINETYPE type,
309 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
311 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
313 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, sx, sy, sz);
318 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddRotation(IDirect3DRMFrame2* iface,
319 D3DRMCOMBINETYPE type,
320 D3DVALUE x, D3DVALUE y, D3DVALUE z,
323 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
325 FIXME("(%p/%p)->(%u,%f,%f,%f,%f): stub\n", iface, This, type, x, y, z, theta);
330 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddVisual(IDirect3DRMFrame2* iface,
331 LPDIRECT3DRMVISUAL vis)
333 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
335 TRACE("(%p/%p)->(%p)\n", iface, This, vis);
337 return IDirect3DRMFrame3_AddVisual(&This->IDirect3DRMFrame3_iface, (LPUNKNOWN)vis);
340 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetChildren(IDirect3DRMFrame2* iface,
341 LPDIRECT3DRMFRAMEARRAY *children)
343 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
345 TRACE("(%p/%p)->(%p)\n", iface, This, children);
347 return IDirect3DRMFrame3_GetChildren(&This->IDirect3DRMFrame3_iface, children);
350 static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetColor(IDirect3DRMFrame2* iface)
352 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
354 FIXME("(%p/%p)->(): stub\n", iface, This);
359 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetLights(IDirect3DRMFrame2* iface,
360 LPDIRECT3DRMLIGHTARRAY *lights)
362 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
364 TRACE("(%p/%p)->(%p)\n", iface, This, lights);
366 return IDirect3DRMFrame3_GetLights(&This->IDirect3DRMFrame3_iface, lights);
369 static D3DRMMATERIALMODE WINAPI IDirect3DRMFrame2Impl_GetMaterialMode(IDirect3DRMFrame2* iface)
371 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
373 FIXME("(%p/%p)->(): stub\n", iface, This);
375 return D3DRMMATERIAL_FROMPARENT;
378 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetParent(IDirect3DRMFrame2* iface,
379 LPDIRECT3DRMFRAME * frame)
381 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
383 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
386 return D3DRMERR_BADVALUE;
390 *frame = (LPDIRECT3DRMFRAME)&This->parent->IDirect3DRMFrame2_iface;
391 IDirect3DRMFrame_AddRef(*frame);
401 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetPosition(IDirect3DRMFrame2* iface,
402 LPDIRECT3DRMFRAME reference,
403 LPD3DVECTOR return_position)
405 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
407 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, reference, return_position);
412 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetRotation(IDirect3DRMFrame2* iface,
413 LPDIRECT3DRMFRAME reference,
414 LPD3DVECTOR axis, LPD3DVALUE return_theta)
416 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
418 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, axis, return_theta);
423 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetScene(IDirect3DRMFrame2* iface,
424 LPDIRECT3DRMFRAME * frame)
426 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
428 FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
433 static D3DRMSORTMODE WINAPI IDirect3DRMFrame2Impl_GetSortMode(IDirect3DRMFrame2* iface)
435 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
437 FIXME("(%p/%p)->(): stub\n", iface, This);
439 return D3DRMSORT_FROMPARENT;
442 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetTexture(IDirect3DRMFrame2* iface,
443 LPDIRECT3DRMTEXTURE * tex)
445 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
447 FIXME("(%p/%p)->(%p): stub\n", iface, This, tex);
452 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetTransform(IDirect3DRMFrame2* iface,
453 D3DRMMATRIX4D return_matrix)
455 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
457 TRACE("(%p/%p)->(%p)\n", iface, This, return_matrix);
459 memcpy(&return_matrix[0][0], &This->transform[0][0], sizeof(D3DRMMATRIX4D));
464 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetVelocity(IDirect3DRMFrame2* iface,
465 LPDIRECT3DRMFRAME reference,
466 LPD3DVECTOR return_velocity,
469 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
471 FIXME("(%p/%p)->(%p,%p,%d): stub\n", iface, This, reference, return_velocity, with_rotation);
476 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetOrientation(IDirect3DRMFrame2* iface,
477 LPDIRECT3DRMFRAME reference,
478 LPD3DVECTOR dir, LPD3DVECTOR up)
480 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
482 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, dir, up);
487 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetVisuals(IDirect3DRMFrame2* iface,
488 LPDIRECT3DRMVISUALARRAY *visuals)
490 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
491 IDirect3DRMVisualArrayImpl* obj;
494 TRACE("(%p/%p)->(%p)\n", iface, This, visuals);
497 return D3DRMERR_BADVALUE;
499 hr = Direct3DRMVisualArray_create(visuals);
504 obj = (IDirect3DRMVisualArrayImpl*)*visuals;
506 obj->size = This->nb_visuals;
507 if (This->nb_visuals)
510 obj->visuals = HeapAlloc(GetProcessHeap(), 0, This->nb_visuals * sizeof(LPDIRECT3DRMVISUAL));
512 return E_OUTOFMEMORY;
513 for (i = 0; i < This->nb_visuals; i++)
515 obj->visuals[i] = This->visuals[i];
516 IDirect3DRMVisual_AddRef(This->visuals[i]);
523 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetTextureTopology(IDirect3DRMFrame2* iface,
524 BOOL *wrap_u, BOOL *wrap_v)
526 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
528 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, wrap_u, wrap_v);
533 static HRESULT WINAPI IDirect3DRMFrame2Impl_InverseTransform(IDirect3DRMFrame2* iface,
534 D3DVECTOR *d, D3DVECTOR *s)
536 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
538 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
543 static HRESULT WINAPI IDirect3DRMFrame2Impl_Load(IDirect3DRMFrame2* iface, LPVOID filename,
544 LPVOID name, D3DRMLOADOPTIONS loadflags,
545 D3DRMLOADTEXTURECALLBACK cb, LPVOID lpArg)
547 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
549 FIXME("(%p/%p)->(%p,%p,%u,%p,%p): stub\n", iface, This, filename, name, loadflags, cb, lpArg);
554 static HRESULT WINAPI IDirect3DRMFrame2Impl_LookAt(IDirect3DRMFrame2* iface,
555 LPDIRECT3DRMFRAME target,
556 LPDIRECT3DRMFRAME reference,
557 D3DRMFRAMECONSTRAINT constraint)
559 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
561 FIXME("(%p/%p)->(%p,%p,%u): stub\n", iface, This, target, reference, constraint);
566 static HRESULT WINAPI IDirect3DRMFrame2Impl_Move(IDirect3DRMFrame2* iface, D3DVALUE delta)
568 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
570 FIXME("(%p/%p)->(%f): stub\n", iface, This, delta);
575 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteChild(IDirect3DRMFrame2* iface,
576 LPDIRECT3DRMFRAME frame)
578 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
579 IDirect3DRMFrameImpl *child = unsafe_impl_from_IDirect3DRMFrame2((LPDIRECT3DRMFRAME2)frame);
581 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
584 return D3DRMERR_BADOBJECT;
586 return IDirect3DRMFrame3_DeleteChild(&This->IDirect3DRMFrame3_iface, &child->IDirect3DRMFrame3_iface);
589 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteLight(IDirect3DRMFrame2* iface,
590 LPDIRECT3DRMLIGHT light)
592 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
594 TRACE("(%p/%p)->(%p)\n", iface, This, light);
596 return IDirect3DRMFrame3_DeleteLight(&This->IDirect3DRMFrame3_iface, light);
599 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteMoveCallback(IDirect3DRMFrame2* iface,
600 D3DRMFRAMEMOVECALLBACK cb, VOID *arg)
602 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
604 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
609 static HRESULT WINAPI IDirect3DRMFrame2Impl_DeleteVisual(IDirect3DRMFrame2* iface,
610 LPDIRECT3DRMVISUAL vis)
612 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
614 TRACE("(%p/%p)->(%p)\n", iface, This, vis);
616 return IDirect3DRMFrame3_DeleteVisual(&This->IDirect3DRMFrame3_iface, (LPUNKNOWN)vis);
619 static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetSceneBackground(IDirect3DRMFrame2* iface)
621 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
623 FIXME("(%p/%p)->(): stub\n", iface, This);
628 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetSceneBackgroundDepth(IDirect3DRMFrame2* iface,
629 LPDIRECTDRAWSURFACE * surface)
631 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
633 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
638 static D3DCOLOR WINAPI IDirect3DRMFrame2Impl_GetSceneFogColor(IDirect3DRMFrame2* iface)
640 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
642 FIXME("(%p/%p)->(): stub\n", iface, This);
647 static BOOL WINAPI IDirect3DRMFrame2Impl_GetSceneFogEnable(IDirect3DRMFrame2* iface)
649 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
651 FIXME("(%p/%p)->(): stub\n", iface, This);
656 static D3DRMFOGMODE WINAPI IDirect3DRMFrame2Impl_GetSceneFogMode(IDirect3DRMFrame2* iface)
658 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
660 FIXME("(%p/%p)->(): stub\n", iface, This);
662 return D3DRMFOG_LINEAR;
665 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetSceneFogParams(IDirect3DRMFrame2* iface,
666 D3DVALUE *return_start,
667 D3DVALUE *return_end,
668 D3DVALUE *return_density)
670 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
672 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, return_start, return_end, return_density);
677 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackground(IDirect3DRMFrame2* iface,
680 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
682 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
687 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackgroundRGB(IDirect3DRMFrame2* iface,
688 D3DVALUE red, D3DVALUE green,
691 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
693 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
698 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackgroundDepth(IDirect3DRMFrame2* iface,
699 LPDIRECTDRAWSURFACE surface)
701 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
703 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
708 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneBackgroundImage(IDirect3DRMFrame2* iface,
709 LPDIRECT3DRMTEXTURE texture)
711 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
713 FIXME("(%p/%p)->(%p): stub\n", iface, This, texture);
718 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogEnable(IDirect3DRMFrame2* iface, BOOL enable)
720 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
722 FIXME("(%p/%p)->(%d): stub\n", iface, This, enable);
727 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogColor(IDirect3DRMFrame2* iface,
730 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
732 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
737 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogMode(IDirect3DRMFrame2* iface,
740 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
742 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
747 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSceneFogParams(IDirect3DRMFrame2* iface,
748 D3DVALUE start, D3DVALUE end,
751 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
753 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, start, end, density);
758 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetColor(IDirect3DRMFrame2* iface, D3DCOLOR color)
760 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
762 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
767 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetColorRGB(IDirect3DRMFrame2* iface, D3DVALUE red,
768 D3DVALUE green, D3DVALUE blue)
770 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
772 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
777 static D3DRMZBUFFERMODE WINAPI IDirect3DRMFrame2Impl_GetZbufferMode(IDirect3DRMFrame2* iface)
779 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
781 FIXME("(%p/%p)->(): stub\n", iface, This);
783 return D3DRMZBUFFER_FROMPARENT;
786 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetMaterialMode(IDirect3DRMFrame2* iface,
787 D3DRMMATERIALMODE mode)
789 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
791 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
796 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetOrientation(IDirect3DRMFrame2* iface,
797 LPDIRECT3DRMFRAME reference,
798 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
799 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz )
801 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
803 FIXME("(%p/%p)->(%p,%f,%f,%f,%f,%f,%f): stub\n", iface, This, reference,
804 dx, dy, dz, ux, uy, uz);
809 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetPosition(IDirect3DRMFrame2* iface,
810 LPDIRECT3DRMFRAME reference,
811 D3DVALUE x, D3DVALUE y, D3DVALUE z)
813 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
815 FIXME("(%p/%p)->(%p,%f,%f,%f): stub\n", iface, This, reference, x, y, z);
820 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetRotation(IDirect3DRMFrame2* iface,
821 LPDIRECT3DRMFRAME reference,
822 D3DVALUE x, D3DVALUE y, D3DVALUE z,
825 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
827 FIXME("(%p/%p)->(%p,%f,%f,%f,%f): stub\n", iface, This, reference, x, y, z, theta);
832 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetSortMode(IDirect3DRMFrame2* iface,
835 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
837 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
842 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetTexture(IDirect3DRMFrame2* iface,
843 LPDIRECT3DRMTEXTURE texture)
845 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
847 FIXME("(%p/%p)->(%p): stub\n", iface, This, texture);
852 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetTextureTopology(IDirect3DRMFrame2* iface,
853 BOOL wrap_u, BOOL wrap_v)
855 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
857 FIXME("(%p/%p)->(%d,%d): stub\n", iface, This, wrap_u, wrap_v);
862 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetVelocity(IDirect3DRMFrame2* iface,
863 LPDIRECT3DRMFRAME reference,
864 D3DVALUE x, D3DVALUE y, D3DVALUE z,
867 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
869 FIXME("(%p/%p)->(%p,%f,%f,%f,%d): stub\n", iface, This, reference, x, y, z, with_rotation);
874 static HRESULT WINAPI IDirect3DRMFrame2Impl_SetZbufferMode(IDirect3DRMFrame2* iface,
875 D3DRMZBUFFERMODE mode)
877 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
879 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
884 static HRESULT WINAPI IDirect3DRMFrame2Impl_Transform(IDirect3DRMFrame2* iface, D3DVECTOR *d,
887 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
889 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
894 /*** IDirect3DRMFrame2 methods ***/
895 static HRESULT WINAPI IDirect3DRMFrame2Impl_AddMoveCallback2(IDirect3DRMFrame2* iface,
896 D3DRMFRAMEMOVECALLBACK cb, VOID *arg,
899 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
901 FIXME("(%p/%p)->(%p,%p,%u): stub\n", iface, This, cb, arg, flags);
906 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetBox(IDirect3DRMFrame2* iface, LPD3DRMBOX box)
908 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
910 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
915 static BOOL WINAPI IDirect3DRMFrame2Impl_GetBoxEnable(IDirect3DRMFrame2* iface)
917 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
919 FIXME("(%p/%p)->(): stub\n", iface, This);
924 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetAxes(IDirect3DRMFrame2* iface,
925 LPD3DVECTOR dir, LPD3DVECTOR up)
927 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
929 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, dir, up);
934 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetMaterial(IDirect3DRMFrame2* iface,
935 LPDIRECT3DRMMATERIAL *material)
937 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
939 FIXME("(%p/%p)->(%p): stub\n", iface, This, material);
944 static BOOL WINAPI IDirect3DRMFrame2Impl_GetInheritAxes(IDirect3DRMFrame2* iface)
946 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
948 FIXME("(%p/%p)->(): stub\n", iface, This);
953 static HRESULT WINAPI IDirect3DRMFrame2Impl_GetHierarchyBox(IDirect3DRMFrame2* iface,
956 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame2(iface);
958 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
963 static const struct IDirect3DRMFrame2Vtbl Direct3DRMFrame2_Vtbl =
965 /*** IUnknown methods ***/
966 IDirect3DRMFrame2Impl_QueryInterface,
967 IDirect3DRMFrame2Impl_AddRef,
968 IDirect3DRMFrame2Impl_Release,
969 /*** IDirect3DRMObject methods ***/
970 IDirect3DRMFrame2Impl_Clone,
971 IDirect3DRMFrame2Impl_AddDestroyCallback,
972 IDirect3DRMFrame2Impl_DeleteDestroyCallback,
973 IDirect3DRMFrame2Impl_SetAppData,
974 IDirect3DRMFrame2Impl_GetAppData,
975 IDirect3DRMFrame2Impl_SetName,
976 IDirect3DRMFrame2Impl_GetName,
977 IDirect3DRMFrame2Impl_GetClassName,
978 /*** IDirect3DRMFrame methods ***/
979 IDirect3DRMFrame2Impl_AddChild,
980 IDirect3DRMFrame2Impl_AddLight,
981 IDirect3DRMFrame2Impl_AddMoveCallback,
982 IDirect3DRMFrame2Impl_AddTransform,
983 IDirect3DRMFrame2Impl_AddTranslation,
984 IDirect3DRMFrame2Impl_AddScale,
985 IDirect3DRMFrame2Impl_AddRotation,
986 IDirect3DRMFrame2Impl_AddVisual,
987 IDirect3DRMFrame2Impl_GetChildren,
988 IDirect3DRMFrame2Impl_GetColor,
989 IDirect3DRMFrame2Impl_GetLights,
990 IDirect3DRMFrame2Impl_GetMaterialMode,
991 IDirect3DRMFrame2Impl_GetParent,
992 IDirect3DRMFrame2Impl_GetPosition,
993 IDirect3DRMFrame2Impl_GetRotation,
994 IDirect3DRMFrame2Impl_GetScene,
995 IDirect3DRMFrame2Impl_GetSortMode,
996 IDirect3DRMFrame2Impl_GetTexture,
997 IDirect3DRMFrame2Impl_GetTransform,
998 IDirect3DRMFrame2Impl_GetVelocity,
999 IDirect3DRMFrame2Impl_GetOrientation,
1000 IDirect3DRMFrame2Impl_GetVisuals,
1001 IDirect3DRMFrame2Impl_GetTextureTopology,
1002 IDirect3DRMFrame2Impl_InverseTransform,
1003 IDirect3DRMFrame2Impl_Load,
1004 IDirect3DRMFrame2Impl_LookAt,
1005 IDirect3DRMFrame2Impl_Move,
1006 IDirect3DRMFrame2Impl_DeleteChild,
1007 IDirect3DRMFrame2Impl_DeleteLight,
1008 IDirect3DRMFrame2Impl_DeleteMoveCallback,
1009 IDirect3DRMFrame2Impl_DeleteVisual,
1010 IDirect3DRMFrame2Impl_GetSceneBackground,
1011 IDirect3DRMFrame2Impl_GetSceneBackgroundDepth,
1012 IDirect3DRMFrame2Impl_GetSceneFogColor,
1013 IDirect3DRMFrame2Impl_GetSceneFogEnable,
1014 IDirect3DRMFrame2Impl_GetSceneFogMode,
1015 IDirect3DRMFrame2Impl_GetSceneFogParams,
1016 IDirect3DRMFrame2Impl_SetSceneBackground,
1017 IDirect3DRMFrame2Impl_SetSceneBackgroundRGB,
1018 IDirect3DRMFrame2Impl_SetSceneBackgroundDepth,
1019 IDirect3DRMFrame2Impl_SetSceneBackgroundImage,
1020 IDirect3DRMFrame2Impl_SetSceneFogEnable,
1021 IDirect3DRMFrame2Impl_SetSceneFogColor,
1022 IDirect3DRMFrame2Impl_SetSceneFogMode,
1023 IDirect3DRMFrame2Impl_SetSceneFogParams,
1024 IDirect3DRMFrame2Impl_SetColor,
1025 IDirect3DRMFrame2Impl_SetColorRGB,
1026 IDirect3DRMFrame2Impl_GetZbufferMode,
1027 IDirect3DRMFrame2Impl_SetMaterialMode,
1028 IDirect3DRMFrame2Impl_SetOrientation,
1029 IDirect3DRMFrame2Impl_SetPosition,
1030 IDirect3DRMFrame2Impl_SetRotation,
1031 IDirect3DRMFrame2Impl_SetSortMode,
1032 IDirect3DRMFrame2Impl_SetTexture,
1033 IDirect3DRMFrame2Impl_SetTextureTopology,
1034 IDirect3DRMFrame2Impl_SetVelocity,
1035 IDirect3DRMFrame2Impl_SetZbufferMode,
1036 IDirect3DRMFrame2Impl_Transform,
1037 /*** IDirect3DRMFrame2 methods ***/
1038 IDirect3DRMFrame2Impl_AddMoveCallback2,
1039 IDirect3DRMFrame2Impl_GetBox,
1040 IDirect3DRMFrame2Impl_GetBoxEnable,
1041 IDirect3DRMFrame2Impl_GetAxes,
1042 IDirect3DRMFrame2Impl_GetMaterial,
1043 IDirect3DRMFrame2Impl_GetInheritAxes,
1044 IDirect3DRMFrame2Impl_GetHierarchyBox
1047 /*** IUnknown methods ***/
1048 static HRESULT WINAPI IDirect3DRMFrame3Impl_QueryInterface(IDirect3DRMFrame3* iface,
1049 REFIID riid, void** object)
1051 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1052 return IDirect3DRMFrame_QueryInterface(&This->IDirect3DRMFrame2_iface, riid, object);
1055 static ULONG WINAPI IDirect3DRMFrame3Impl_AddRef(IDirect3DRMFrame3* iface)
1057 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1058 return IDirect3DRMFrame2_AddRef(&This->IDirect3DRMFrame2_iface);
1061 static ULONG WINAPI IDirect3DRMFrame3Impl_Release(IDirect3DRMFrame3* iface)
1063 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1064 return IDirect3DRMFrame2_Release(&This->IDirect3DRMFrame2_iface);
1067 /*** IDirect3DRMObject methods ***/
1068 static HRESULT WINAPI IDirect3DRMFrame3Impl_Clone(IDirect3DRMFrame3* iface,
1069 LPUNKNOWN unkwn, REFIID riid,
1072 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1074 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
1079 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddDestroyCallback(IDirect3DRMFrame3* iface,
1080 D3DRMOBJECTCALLBACK cb,
1083 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1085 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
1090 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteDestroyCallback(IDirect3DRMFrame3* iface,
1091 D3DRMOBJECTCALLBACK cb,
1094 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1096 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
1101 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetAppData(IDirect3DRMFrame3* iface,
1104 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1106 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
1111 static DWORD WINAPI IDirect3DRMFrame3Impl_GetAppData(IDirect3DRMFrame3* iface)
1113 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1115 FIXME("(%p/%p)->(): stub\n", iface, This);
1120 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetName(IDirect3DRMFrame3* iface, LPCSTR name)
1122 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1124 FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
1129 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetName(IDirect3DRMFrame3* iface,
1130 LPDWORD size, LPSTR name)
1132 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1134 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
1139 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetClassName(IDirect3DRMFrame3* iface,
1140 LPDWORD size, LPSTR name)
1142 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1144 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
1149 /*** IDirect3DRMFrame methods ***/
1150 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddChild(IDirect3DRMFrame3* iface,
1151 LPDIRECT3DRMFRAME3 child)
1153 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1154 IDirect3DRMFrameImpl *child_obj = unsafe_impl_from_IDirect3DRMFrame3(child);
1156 TRACE("(%p/%p)->(%p)\n", iface, This, child);
1159 return D3DRMERR_BADOBJECT;
1161 if (child_obj->parent)
1163 IDirect3DRMFrame3* parent = &child_obj->parent->IDirect3DRMFrame3_iface;
1165 if (parent == iface)
1167 /* Passed frame is already a child so return success */
1172 /* Remove parent and continue */
1173 IDirect3DRMFrame3_DeleteChild(parent, child);
1177 if ((This->nb_children + 1) > This->children_capacity)
1180 IDirect3DRMFrame3** children;
1182 if (!This->children_capacity)
1185 children = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMFrame3*));
1189 new_capacity = This->children_capacity * 2;
1190 children = HeapReAlloc(GetProcessHeap(), 0, This->children, new_capacity * sizeof(IDirect3DRMFrame3*));
1194 return E_OUTOFMEMORY;
1196 This->children_capacity = new_capacity;
1197 This->children = children;
1200 This->children[This->nb_children++] = child;
1201 IDirect3DRMFrame3_AddRef(child);
1202 child_obj->parent = This;
1207 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddLight(IDirect3DRMFrame3* iface,
1208 LPDIRECT3DRMLIGHT light)
1210 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1212 IDirect3DRMLight** lights;
1214 TRACE("(%p/%p)->(%p)\n", iface, This, light);
1217 return D3DRMERR_BADOBJECT;
1219 /* Check if already existing and return gracefully without increasing ref count */
1220 for (i = 0; i < This->nb_lights; i++)
1221 if (This->lights[i] == light)
1224 if ((This->nb_lights + 1) > This->lights_capacity)
1228 if (!This->lights_capacity)
1231 lights = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMLight*));
1235 new_capacity = This->lights_capacity * 2;
1236 lights = HeapReAlloc(GetProcessHeap(), 0, This->lights, new_capacity * sizeof(IDirect3DRMLight*));
1240 return E_OUTOFMEMORY;
1242 This->lights_capacity = new_capacity;
1243 This->lights = lights;
1246 This->lights[This->nb_lights++] = light;
1247 IDirect3DRMLight_AddRef(light);
1252 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddMoveCallback(IDirect3DRMFrame3* iface,
1253 D3DRMFRAME3MOVECALLBACK cb, VOID *arg,
1256 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1258 FIXME("(%p/%p)->(%p,%p,%u): stub\n", iface, This, cb, arg, flags);
1263 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddTransform(IDirect3DRMFrame3* iface,
1264 D3DRMCOMBINETYPE type,
1265 D3DRMMATRIX4D matrix)
1267 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1269 TRACE("(%p/%p)->(%u,%p)\n", iface, This, type, matrix);
1273 case D3DRMCOMBINE_REPLACE:
1274 memcpy(&This->transform[0][0], &matrix[0][0], sizeof(D3DRMMATRIX4D));
1277 case D3DRMCOMBINE_BEFORE:
1278 FIXME("D3DRMCOMBINE_BEFORE not supported yed\n");
1281 case D3DRMCOMBINE_AFTER:
1282 FIXME("D3DRMCOMBINE_AFTER not supported yed\n");
1286 WARN("Unknown Combine Type %u\n", type);
1287 return D3DRMERR_BADVALUE;
1293 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddTranslation(IDirect3DRMFrame3* iface,
1294 D3DRMCOMBINETYPE type,
1295 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1297 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1299 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, x, y, z);
1304 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddScale(IDirect3DRMFrame3* iface,
1305 D3DRMCOMBINETYPE type,
1306 D3DVALUE sx, D3DVALUE sy, D3DVALUE sz)
1308 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1310 FIXME("(%p/%p)->(%u,%f,%f,%f): stub\n", iface, This, type, sx, sy, sz);
1315 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddRotation(IDirect3DRMFrame3* iface,
1316 D3DRMCOMBINETYPE type,
1317 D3DVALUE x, D3DVALUE y, D3DVALUE z,
1320 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1322 FIXME("(%p/%p)->(%u,%f,%f,%f,%f): stub\n", iface, This, type, x, y, z, theta);
1327 static HRESULT WINAPI IDirect3DRMFrame3Impl_AddVisual(IDirect3DRMFrame3* iface, LPUNKNOWN vis)
1329 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1331 IDirect3DRMVisual** visuals;
1333 TRACE("(%p/%p)->(%p)\n", iface, This, vis);
1336 return D3DRMERR_BADOBJECT;
1338 /* Check if already existing and return gracefully without increasing ref count */
1339 for (i = 0; i < This->nb_visuals; i++)
1340 if (This->visuals[i] == (IDirect3DRMVisual*)vis)
1343 if ((This->nb_visuals + 1) > This->visuals_capacity)
1347 if (!This->visuals_capacity)
1350 visuals = HeapAlloc(GetProcessHeap(), 0, new_capacity * sizeof(IDirect3DRMVisual*));
1354 new_capacity = This->visuals_capacity * 2;
1355 visuals = HeapReAlloc(GetProcessHeap(), 0, This->visuals, new_capacity * sizeof(IDirect3DRMVisual*));
1359 return E_OUTOFMEMORY;
1361 This->visuals_capacity = new_capacity;
1362 This->visuals = visuals;
1365 This->visuals[This->nb_visuals++] = (IDirect3DRMVisual*)vis;
1366 IDirect3DRMVisual_AddRef(vis);
1371 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetChildren(IDirect3DRMFrame3* iface,
1372 LPDIRECT3DRMFRAMEARRAY *children)
1374 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1375 IDirect3DRMFrameArrayImpl* obj;
1378 TRACE("(%p/%p)->(%p)\n", iface, This, children);
1381 return D3DRMERR_BADVALUE;
1383 hr = Direct3DRMFrameArray_create(children);
1388 obj = (IDirect3DRMFrameArrayImpl*)*children;
1390 obj->size = This->nb_children;
1391 if (This->nb_children)
1394 obj->frames = HeapAlloc(GetProcessHeap(), 0, This->nb_children * sizeof(LPDIRECT3DRMFRAME));
1396 return E_OUTOFMEMORY;
1397 for (i = 0; i < This->nb_children; i++)
1398 IDirect3DRMFrame3_QueryInterface(This->children[i], &IID_IDirect3DRMFrame, (void**)&obj->frames[i]);
1404 static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetColor(IDirect3DRMFrame3* iface)
1406 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1408 FIXME("(%p/%p)->(): stub\n", iface, This);
1413 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetLights(IDirect3DRMFrame3* iface,
1414 LPDIRECT3DRMLIGHTARRAY *lights)
1416 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1417 IDirect3DRMLightArrayImpl* obj;
1420 TRACE("(%p/%p)->(%p)\n", iface, This, lights);
1423 return D3DRMERR_BADVALUE;
1425 hr = Direct3DRMLightArray_create(lights);
1430 obj = (IDirect3DRMLightArrayImpl*)*lights;
1432 obj->size = This->nb_lights;
1433 if (This->nb_lights)
1436 obj->lights = HeapAlloc(GetProcessHeap(), 0, This->nb_lights * sizeof(LPDIRECT3DRMLIGHT));
1438 return E_OUTOFMEMORY;
1439 for (i = 0; i < This->nb_lights; i++)
1440 IDirect3DRMLight_QueryInterface(This->lights[i], &IID_IDirect3DRMLight, (void**)&obj->lights[i]);
1446 static D3DRMMATERIALMODE WINAPI IDirect3DRMFrame3Impl_GetMaterialMode(IDirect3DRMFrame3* iface)
1448 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1450 FIXME("(%p/%p)->(): stub\n", iface, This);
1452 return D3DRMMATERIAL_FROMPARENT;
1455 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetParent(IDirect3DRMFrame3* iface,
1456 LPDIRECT3DRMFRAME3 * frame)
1458 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1460 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
1463 return D3DRMERR_BADVALUE;
1467 *frame = &This->parent->IDirect3DRMFrame3_iface;
1468 IDirect3DRMFrame_AddRef(*frame);
1478 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetPosition(IDirect3DRMFrame3* iface,
1479 LPDIRECT3DRMFRAME3 reference,
1480 LPD3DVECTOR return_position)
1482 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1484 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, reference, return_position);
1489 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetRotation(IDirect3DRMFrame3* iface,
1490 LPDIRECT3DRMFRAME3 reference,
1491 LPD3DVECTOR axis, LPD3DVALUE return_theta)
1493 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1495 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, axis, return_theta);
1500 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetScene(IDirect3DRMFrame3* iface,
1501 LPDIRECT3DRMFRAME3 * frame)
1503 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1505 FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
1510 static D3DRMSORTMODE WINAPI IDirect3DRMFrame3Impl_GetSortMode(IDirect3DRMFrame3* iface)
1512 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1514 FIXME("(%p/%p)->(): stub\n", iface, This);
1516 return D3DRMSORT_FROMPARENT;
1519 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetTexture(IDirect3DRMFrame3* iface,
1520 LPDIRECT3DRMTEXTURE3 * tex)
1522 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1524 FIXME("(%p/%p)->(%p): stub\n", iface, This, tex);
1529 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetTransform(IDirect3DRMFrame3* iface,
1530 LPDIRECT3DRMFRAME3 reference,
1531 D3DRMMATRIX4D return_matrix)
1533 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1535 TRACE("(%p/%p)->(%p,%p)\n", iface, This, reference, return_matrix);
1538 FIXME("Specifying a frame as the root of the scene different from the current root frame is not supported yet\n");
1540 memcpy(&return_matrix[0][0], &This->transform[0][0], sizeof(D3DRMMATRIX4D));
1545 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetVelocity(IDirect3DRMFrame3* iface,
1546 LPDIRECT3DRMFRAME3 reference,
1547 LPD3DVECTOR return_velocity,
1550 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1552 FIXME("(%p/%p)->(%p,%p,%d): stub\n", iface, This, reference, return_velocity, with_rotation);
1557 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetOrientation(IDirect3DRMFrame3* iface,
1558 LPDIRECT3DRMFRAME3 reference,
1559 LPD3DVECTOR dir, LPD3DVECTOR up)
1561 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1563 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, reference, dir, up);
1568 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetVisuals(IDirect3DRMFrame3* iface, LPDWORD num,
1571 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1573 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, num, visuals);
1578 static HRESULT WINAPI IDirect3DRMFrame3Impl_InverseTransform(IDirect3DRMFrame3* iface,
1579 D3DVECTOR *d, D3DVECTOR *s)
1581 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1583 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
1588 static HRESULT WINAPI IDirect3DRMFrame3Impl_Load(IDirect3DRMFrame3* iface, LPVOID filename,
1589 LPVOID name, D3DRMLOADOPTIONS loadflags,
1590 D3DRMLOADTEXTURE3CALLBACK cb, LPVOID lpArg)
1592 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1594 FIXME("(%p/%p)->(%p,%p,%u,%p,%p): stub\n", iface, This, filename, name, loadflags, cb, lpArg);
1599 static HRESULT WINAPI IDirect3DRMFrame3Impl_LookAt(IDirect3DRMFrame3* iface,
1600 LPDIRECT3DRMFRAME3 target,
1601 LPDIRECT3DRMFRAME3 reference,
1602 D3DRMFRAMECONSTRAINT constraint)
1604 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1606 FIXME("(%p/%p)->(%p,%p,%u): stub\n", iface, This, target, reference, constraint);
1611 static HRESULT WINAPI IDirect3DRMFrame3Impl_Move(IDirect3DRMFrame3* iface, D3DVALUE delta)
1613 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1615 FIXME("(%p/%p)->(%f): stub\n", iface, This, delta);
1620 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteChild(IDirect3DRMFrame3* iface,
1621 LPDIRECT3DRMFRAME3 frame)
1623 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1624 IDirect3DRMFrameImpl *frame_obj = unsafe_impl_from_IDirect3DRMFrame3(frame);
1627 TRACE("(%p/%p)->(%p)\n", iface, This, frame);
1630 return D3DRMERR_BADOBJECT;
1632 /* Check if child exists */
1633 for (i = 0; i < This->nb_children; i++)
1634 if (This->children[i] == frame)
1637 if (i == This->nb_children)
1638 return D3DRMERR_BADVALUE;
1640 memmove(This->children + i, This->children + i + 1, sizeof(IDirect3DRMFrame3*) * (This->nb_children - 1 - i));
1641 IDirect3DRMFrame3_Release(frame);
1642 frame_obj->parent = NULL;
1643 This->nb_children--;
1648 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteLight(IDirect3DRMFrame3* iface,
1649 LPDIRECT3DRMLIGHT light)
1651 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1654 TRACE("(%p/%p)->(%p)\n", iface, This, light);
1657 return D3DRMERR_BADOBJECT;
1659 /* Check if visual exists */
1660 for (i = 0; i < This->nb_lights; i++)
1661 if (This->lights[i] == light)
1664 if (i == This->nb_lights)
1665 return D3DRMERR_BADVALUE;
1667 memmove(This->lights + i, This->lights + i + 1, sizeof(IDirect3DRMLight*) * (This->nb_lights - 1 - i));
1668 IDirect3DRMLight_Release(light);
1674 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteMoveCallback(IDirect3DRMFrame3* iface,
1675 D3DRMFRAME3MOVECALLBACK cb,
1678 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1680 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, arg);
1685 static HRESULT WINAPI IDirect3DRMFrame3Impl_DeleteVisual(IDirect3DRMFrame3* iface, LPUNKNOWN vis)
1687 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1690 TRACE("(%p/%p)->(%p)\n", iface, This, vis);
1693 return D3DRMERR_BADOBJECT;
1695 /* Check if visual exists */
1696 for (i = 0; i < This->nb_visuals; i++)
1697 if (This->visuals[i] == (IDirect3DRMVisual*)vis)
1700 if (i == This->nb_visuals)
1701 return D3DRMERR_BADVALUE;
1703 memmove(This->visuals + i, This->visuals + i + 1, sizeof(IDirect3DRMVisual*) * (This->nb_visuals - 1 - i));
1704 IDirect3DRMVisual_Release(vis);
1710 static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetSceneBackground(IDirect3DRMFrame3* iface)
1712 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1714 FIXME("(%p/%p)->(): stub\n", iface, This);
1719 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetSceneBackgroundDepth(IDirect3DRMFrame3* iface,
1720 LPDIRECTDRAWSURFACE * surface)
1722 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1724 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
1729 static D3DCOLOR WINAPI IDirect3DRMFrame3Impl_GetSceneFogColor(IDirect3DRMFrame3* iface)
1731 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1733 FIXME("(%p/%p)->(): stub\n", iface, This);
1738 static BOOL WINAPI IDirect3DRMFrame3Impl_GetSceneFogEnable(IDirect3DRMFrame3* iface)
1740 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1742 FIXME("(%p/%p)->(): stub\n", iface, This);
1747 static D3DRMFOGMODE WINAPI IDirect3DRMFrame3Impl_GetSceneFogMode(IDirect3DRMFrame3* iface)
1749 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1751 FIXME("(%p/%p)->(): stub\n", iface, This);
1753 return D3DRMFOG_LINEAR;
1756 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetSceneFogParams(IDirect3DRMFrame3* iface,
1757 D3DVALUE *return_start,
1758 D3DVALUE *return_end,
1759 D3DVALUE *return_density)
1761 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1763 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, return_start, return_end, return_density);
1768 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackground(IDirect3DRMFrame3* iface,
1771 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1773 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
1778 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackgroundRGB(IDirect3DRMFrame3* iface,
1779 D3DVALUE red, D3DVALUE green,
1782 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1784 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
1789 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackgroundDepth(IDirect3DRMFrame3* iface,
1790 LPDIRECTDRAWSURFACE surface)
1792 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1794 FIXME("(%p/%p)->(%p): stub\n", iface, This, surface);
1799 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneBackgroundImage(IDirect3DRMFrame3* iface,
1800 LPDIRECT3DRMTEXTURE3 texture)
1802 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1804 FIXME("(%p/%p)->(%p): stub\n", iface, This, texture);
1809 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogEnable(IDirect3DRMFrame3* iface, BOOL enable)
1811 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1813 FIXME("(%p/%p)->(%d): stub\n", iface, This, enable);
1818 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogColor(IDirect3DRMFrame3* iface,
1821 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1823 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
1828 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogMode(IDirect3DRMFrame3* iface,
1831 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1833 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1838 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogParams(IDirect3DRMFrame3* iface,
1839 D3DVALUE start, D3DVALUE end,
1842 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1844 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, start, end, density);
1849 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetColor(IDirect3DRMFrame3* iface, D3DCOLOR color)
1851 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1853 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
1858 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetColorRGB(IDirect3DRMFrame3* iface, D3DVALUE red,
1859 D3DVALUE green, D3DVALUE blue)
1861 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1863 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
1868 static D3DRMZBUFFERMODE WINAPI IDirect3DRMFrame3Impl_GetZbufferMode(IDirect3DRMFrame3* iface)
1870 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1872 FIXME("(%p/%p)->(): stub\n", iface, This);
1874 return D3DRMZBUFFER_FROMPARENT;
1877 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetMaterialMode(IDirect3DRMFrame3* iface,
1878 D3DRMMATERIALMODE mode)
1880 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1882 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1887 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetOrientation(IDirect3DRMFrame3* iface,
1888 LPDIRECT3DRMFRAME3 reference,
1889 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
1890 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz )
1892 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1894 FIXME("(%p/%p)->(%p,%f,%f,%f,%f,%f,%f): stub\n", iface, This, reference,
1895 dx, dy, dz, ux, uy, uz);
1900 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetPosition(IDirect3DRMFrame3* iface,
1901 LPDIRECT3DRMFRAME3 reference,
1902 D3DVALUE x, D3DVALUE y, D3DVALUE z)
1904 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1906 FIXME("(%p/%p)->(%p,%f,%f,%f): stub\n", iface, This, reference, x, y, z);
1911 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetRotation(IDirect3DRMFrame3* iface,
1912 LPDIRECT3DRMFRAME3 reference,
1913 D3DVALUE x, D3DVALUE y, D3DVALUE z,
1916 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1918 FIXME("(%p/%p)->(%p,%f,%f,%f,%f): stub\n", iface, This, reference, x, y, z, theta);
1923 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSortMode(IDirect3DRMFrame3* iface,
1926 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1928 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1933 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetTexture(IDirect3DRMFrame3* iface,
1934 LPDIRECT3DRMTEXTURE3 texture)
1936 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1938 FIXME("(%p/%p)->(%p): stub\n", iface, This, texture);
1943 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetVelocity(IDirect3DRMFrame3* iface,
1944 LPDIRECT3DRMFRAME3 reference,
1945 D3DVALUE x, D3DVALUE y, D3DVALUE z,
1948 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1950 FIXME("(%p/%p)->(%p,%f,%f,%f,%d): stub\n", iface, This, reference, x, y, z, with_rotation);
1955 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetZbufferMode(IDirect3DRMFrame3* iface,
1956 D3DRMZBUFFERMODE mode)
1958 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1960 FIXME("(%p/%p)->(%u): stub\n", iface, This, mode);
1965 static HRESULT WINAPI IDirect3DRMFrame3Impl_Transform(IDirect3DRMFrame3* iface, D3DVECTOR *d,
1968 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1970 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, d, s);
1975 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetBox(IDirect3DRMFrame3* iface, LPD3DRMBOX box)
1977 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1979 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
1984 static BOOL WINAPI IDirect3DRMFrame3Impl_GetBoxEnable(IDirect3DRMFrame3* iface)
1986 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1988 FIXME("(%p/%p)->(): stub\n", iface, This);
1993 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetAxes(IDirect3DRMFrame3* iface,
1994 LPD3DVECTOR dir, LPD3DVECTOR up)
1996 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
1998 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, dir, up);
2003 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetMaterial(IDirect3DRMFrame3* iface,
2004 LPDIRECT3DRMMATERIAL2 *material)
2006 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2008 FIXME("(%p/%p)->(%p): stub\n", iface, This, material);
2013 static BOOL WINAPI IDirect3DRMFrame3Impl_GetInheritAxes(IDirect3DRMFrame3* iface)
2015 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2017 FIXME("(%p/%p)->(): stub\n", iface, This);
2022 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetHierarchyBox(IDirect3DRMFrame3* iface,
2025 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2027 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
2032 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetBox(IDirect3DRMFrame3* iface, LPD3DRMBOX box)
2034 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2036 FIXME("(%p/%p)->(%p): stub\n", iface, This, box);
2041 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetBoxEnable(IDirect3DRMFrame3* iface, BOOL enable)
2043 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2045 FIXME("(%p/%p)->(%u): stub\n", iface, This, enable);
2050 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetAxes(IDirect3DRMFrame3* iface,
2051 D3DVALUE dx, D3DVALUE dy, D3DVALUE dz,
2052 D3DVALUE ux, D3DVALUE uy, D3DVALUE uz)
2054 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2056 FIXME("(%p/%p)->(%f,%f,%f,%f,%f,%f): stub\n", iface, This, dx, dy, dz, ux, uy, uz);
2061 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetInheritAxes(IDirect3DRMFrame3* iface,
2062 BOOL inherit_from_parent)
2064 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2066 FIXME("(%p/%p)->(%u): stub\n", iface, This, inherit_from_parent);
2071 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetMaterial(IDirect3DRMFrame3* iface,
2072 LPDIRECT3DRMMATERIAL2 material)
2074 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2076 FIXME("(%p/%p)->(%p): stub\n", iface, This, material);
2081 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetQuaternion(IDirect3DRMFrame3* iface,
2082 LPDIRECT3DRMFRAME3 reference,
2085 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2087 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, reference, q);
2092 static HRESULT WINAPI IDirect3DRMFrame3Impl_RayPick(IDirect3DRMFrame3* iface,
2093 LPDIRECT3DRMFRAME3 reference, LPD3DRMRAY ray,
2095 LPDIRECT3DRMPICKED2ARRAY *return_visuals)
2097 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2099 FIXME("(%p/%p)->(%p,%p,%u,%p): stub\n", iface, This, reference, ray, flags, return_visuals);
2104 static HRESULT WINAPI IDirect3DRMFrame3Impl_Save(IDirect3DRMFrame3* iface, LPCSTR filename,
2105 D3DRMXOFFORMAT d3dFormat,
2106 D3DRMSAVEOPTIONS d3dSaveFlags)
2108 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2110 FIXME("(%p/%p)->(%p,%u,%u): stub\n", iface, This, filename, d3dFormat, d3dSaveFlags);
2115 static HRESULT WINAPI IDirect3DRMFrame3Impl_TransformVectors(IDirect3DRMFrame3* iface,
2116 LPDIRECT3DRMFRAME3 reference,
2117 DWORD num, LPD3DVECTOR dst,
2120 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2122 FIXME("(%p/%p)->(%p,%u,%p,%p): stub\n", iface, This, reference, num, dst, src);
2127 static HRESULT WINAPI IDirect3DRMFrame3Impl_InverseTransformVectors(IDirect3DRMFrame3* iface,
2128 LPDIRECT3DRMFRAME3 reference,
2129 DWORD num, LPD3DVECTOR dst,
2132 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2134 FIXME("(%p/%p)->(%p,%u,%p,%p): stub\n", iface, This, reference, num, dst, src);
2139 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetTraversalOptions(IDirect3DRMFrame3* iface,
2142 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2144 FIXME("(%p/%p)->(%u): stub\n", iface, This, flags);
2149 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetTraversalOptions(IDirect3DRMFrame3* iface,
2152 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2154 FIXME("(%p/%p)->(%p): stub\n", iface, This, flags);
2159 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetSceneFogMethod(IDirect3DRMFrame3* iface,
2162 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2164 FIXME("(%p/%p)->(%u): stub\n", iface, This, flags);
2169 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetSceneFogMethod(IDirect3DRMFrame3* iface,
2172 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2174 FIXME("(%p/%p)->(%p): stub\n", iface, This, flags);
2179 static HRESULT WINAPI IDirect3DRMFrame3Impl_SetMaterialOverride(IDirect3DRMFrame3* iface,
2180 LPD3DRMMATERIALOVERRIDE override)
2182 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2184 FIXME("(%p/%p)->(%p): stub\n", iface, This, override);
2189 static HRESULT WINAPI IDirect3DRMFrame3Impl_GetMaterialOverride(IDirect3DRMFrame3* iface,
2190 LPD3DRMMATERIALOVERRIDE override)
2192 IDirect3DRMFrameImpl *This = impl_from_IDirect3DRMFrame3(iface);
2194 FIXME("(%p/%p)->(%p): stub\n", iface, This, override);
2199 static const struct IDirect3DRMFrame3Vtbl Direct3DRMFrame3_Vtbl =
2201 /*** IUnknown methods ***/
2202 IDirect3DRMFrame3Impl_QueryInterface,
2203 IDirect3DRMFrame3Impl_AddRef,
2204 IDirect3DRMFrame3Impl_Release,
2205 /*** IDirect3DRMObject methods ***/
2206 IDirect3DRMFrame3Impl_Clone,
2207 IDirect3DRMFrame3Impl_AddDestroyCallback,
2208 IDirect3DRMFrame3Impl_DeleteDestroyCallback,
2209 IDirect3DRMFrame3Impl_SetAppData,
2210 IDirect3DRMFrame3Impl_GetAppData,
2211 IDirect3DRMFrame3Impl_SetName,
2212 IDirect3DRMFrame3Impl_GetName,
2213 IDirect3DRMFrame3Impl_GetClassName,
2214 /*** IDirect3DRMFrame3 methods ***/
2215 IDirect3DRMFrame3Impl_AddChild,
2216 IDirect3DRMFrame3Impl_AddLight,
2217 IDirect3DRMFrame3Impl_AddMoveCallback,
2218 IDirect3DRMFrame3Impl_AddTransform,
2219 IDirect3DRMFrame3Impl_AddTranslation,
2220 IDirect3DRMFrame3Impl_AddScale,
2221 IDirect3DRMFrame3Impl_AddRotation,
2222 IDirect3DRMFrame3Impl_AddVisual,
2223 IDirect3DRMFrame3Impl_GetChildren,
2224 IDirect3DRMFrame3Impl_GetColor,
2225 IDirect3DRMFrame3Impl_GetLights,
2226 IDirect3DRMFrame3Impl_GetMaterialMode,
2227 IDirect3DRMFrame3Impl_GetParent,
2228 IDirect3DRMFrame3Impl_GetPosition,
2229 IDirect3DRMFrame3Impl_GetRotation,
2230 IDirect3DRMFrame3Impl_GetScene,
2231 IDirect3DRMFrame3Impl_GetSortMode,
2232 IDirect3DRMFrame3Impl_GetTexture,
2233 IDirect3DRMFrame3Impl_GetTransform,
2234 IDirect3DRMFrame3Impl_GetVelocity,
2235 IDirect3DRMFrame3Impl_GetOrientation,
2236 IDirect3DRMFrame3Impl_GetVisuals,
2237 IDirect3DRMFrame3Impl_InverseTransform,
2238 IDirect3DRMFrame3Impl_Load,
2239 IDirect3DRMFrame3Impl_LookAt,
2240 IDirect3DRMFrame3Impl_Move,
2241 IDirect3DRMFrame3Impl_DeleteChild,
2242 IDirect3DRMFrame3Impl_DeleteLight,
2243 IDirect3DRMFrame3Impl_DeleteMoveCallback,
2244 IDirect3DRMFrame3Impl_DeleteVisual,
2245 IDirect3DRMFrame3Impl_GetSceneBackground,
2246 IDirect3DRMFrame3Impl_GetSceneBackgroundDepth,
2247 IDirect3DRMFrame3Impl_GetSceneFogColor,
2248 IDirect3DRMFrame3Impl_GetSceneFogEnable,
2249 IDirect3DRMFrame3Impl_GetSceneFogMode,
2250 IDirect3DRMFrame3Impl_GetSceneFogParams,
2251 IDirect3DRMFrame3Impl_SetSceneBackground,
2252 IDirect3DRMFrame3Impl_SetSceneBackgroundRGB,
2253 IDirect3DRMFrame3Impl_SetSceneBackgroundDepth,
2254 IDirect3DRMFrame3Impl_SetSceneBackgroundImage,
2255 IDirect3DRMFrame3Impl_SetSceneFogEnable,
2256 IDirect3DRMFrame3Impl_SetSceneFogColor,
2257 IDirect3DRMFrame3Impl_SetSceneFogMode,
2258 IDirect3DRMFrame3Impl_SetSceneFogParams,
2259 IDirect3DRMFrame3Impl_SetColor,
2260 IDirect3DRMFrame3Impl_SetColorRGB,
2261 IDirect3DRMFrame3Impl_GetZbufferMode,
2262 IDirect3DRMFrame3Impl_SetMaterialMode,
2263 IDirect3DRMFrame3Impl_SetOrientation,
2264 IDirect3DRMFrame3Impl_SetPosition,
2265 IDirect3DRMFrame3Impl_SetRotation,
2266 IDirect3DRMFrame3Impl_SetSortMode,
2267 IDirect3DRMFrame3Impl_SetTexture,
2268 IDirect3DRMFrame3Impl_SetVelocity,
2269 IDirect3DRMFrame3Impl_SetZbufferMode,
2270 IDirect3DRMFrame3Impl_Transform,
2271 IDirect3DRMFrame3Impl_GetBox,
2272 IDirect3DRMFrame3Impl_GetBoxEnable,
2273 IDirect3DRMFrame3Impl_GetAxes,
2274 IDirect3DRMFrame3Impl_GetMaterial,
2275 IDirect3DRMFrame3Impl_GetInheritAxes,
2276 IDirect3DRMFrame3Impl_GetHierarchyBox,
2277 IDirect3DRMFrame3Impl_SetBox,
2278 IDirect3DRMFrame3Impl_SetBoxEnable,
2279 IDirect3DRMFrame3Impl_SetAxes,
2280 IDirect3DRMFrame3Impl_SetInheritAxes,
2281 IDirect3DRMFrame3Impl_SetMaterial,
2282 IDirect3DRMFrame3Impl_SetQuaternion,
2283 IDirect3DRMFrame3Impl_RayPick,
2284 IDirect3DRMFrame3Impl_Save,
2285 IDirect3DRMFrame3Impl_TransformVectors,
2286 IDirect3DRMFrame3Impl_InverseTransformVectors,
2287 IDirect3DRMFrame3Impl_SetTraversalOptions,
2288 IDirect3DRMFrame3Impl_GetTraversalOptions,
2289 IDirect3DRMFrame3Impl_SetSceneFogMethod,
2290 IDirect3DRMFrame3Impl_GetSceneFogMethod,
2291 IDirect3DRMFrame3Impl_SetMaterialOverride,
2292 IDirect3DRMFrame3Impl_GetMaterialOverride
2295 static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame2(IDirect3DRMFrame2 *iface)
2299 assert(iface->lpVtbl == &Direct3DRMFrame2_Vtbl);
2301 return impl_from_IDirect3DRMFrame2(iface);
2304 static inline IDirect3DRMFrameImpl *unsafe_impl_from_IDirect3DRMFrame3(IDirect3DRMFrame3 *iface)
2308 assert(iface->lpVtbl == &Direct3DRMFrame3_Vtbl);
2310 return impl_from_IDirect3DRMFrame3(iface);
2313 HRESULT Direct3DRMFrame_create(REFIID riid, IUnknown* parent, IUnknown** ret_iface)
2315 IDirect3DRMFrameImpl* object;
2317 TRACE("(%s, %p, %p)\n", wine_dbgstr_guid(riid), parent, ret_iface);
2319 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMFrameImpl));
2322 ERR("Out of memory\n");
2323 return E_OUTOFMEMORY;
2326 object->IDirect3DRMFrame2_iface.lpVtbl = &Direct3DRMFrame2_Vtbl;
2327 object->IDirect3DRMFrame3_iface.lpVtbl = &Direct3DRMFrame3_Vtbl;
2330 memcpy(&object->transform[0][0], &identity[0][0], sizeof(D3DRMMATRIX4D));
2332 if (IsEqualGUID(riid, &IID_IDirect3DRMFrame3))
2335 IDirect3DRMFrame3_AddChild((IDirect3DRMFrame3*)parent, &object->IDirect3DRMFrame3_iface);
2336 *ret_iface = (IUnknown*)&object->IDirect3DRMFrame3_iface;
2341 IDirect3DRMFrame2_AddChild((IDirect3DRMFrame2*)parent, (IDirect3DRMFrame*)&object->IDirect3DRMFrame2_iface);
2342 *ret_iface = (IUnknown*)&object->IDirect3DRMFrame2_iface;
2348 /*** IUnknown methods ***/
2349 static HRESULT WINAPI IDirect3DRMFrameArrayImpl_QueryInterface(IDirect3DRMFrameArray* iface,
2350 REFIID riid, void** object)
2352 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
2354 TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
2358 if (IsEqualGUID(riid, &IID_IUnknown) ||
2359 IsEqualGUID(riid, &IID_IDirect3DRMFrameArray))
2361 *object = &This->IDirect3DRMFrameArray_iface;
2365 FIXME("interface %s not implemented\n", debugstr_guid(riid));
2366 return E_NOINTERFACE;
2369 IDirect3DRMFrameArray_AddRef(iface);
2373 static ULONG WINAPI IDirect3DRMFrameArrayImpl_AddRef(IDirect3DRMFrameArray* iface)
2375 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
2376 ULONG ref = InterlockedIncrement(&This->ref);
2378 TRACE("(%p)->(): new ref = %u\n", This, ref);
2383 static ULONG WINAPI IDirect3DRMFrameArrayImpl_Release(IDirect3DRMFrameArray* iface)
2385 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
2386 ULONG ref = InterlockedDecrement(&This->ref);
2389 TRACE("(%p)->(): new ref = %u\n", This, ref);
2393 for (i = 0; i < This->size; i++)
2394 IDirect3DRMFrame_Release(This->frames[i]);
2395 HeapFree(GetProcessHeap(), 0, This->frames);
2396 HeapFree(GetProcessHeap(), 0, This);
2402 /*** IDirect3DRMArray methods ***/
2403 static DWORD WINAPI IDirect3DRMFrameArrayImpl_GetSize(IDirect3DRMFrameArray* iface)
2405 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
2407 TRACE("(%p)->() = %d\n", This, This->size);
2412 /*** IDirect3DRMFrameArray methods ***/
2413 static HRESULT WINAPI IDirect3DRMFrameArrayImpl_GetElement(IDirect3DRMFrameArray* iface, DWORD index, LPDIRECT3DRMFRAME* frame)
2415 IDirect3DRMFrameArrayImpl *This = (IDirect3DRMFrameArrayImpl*)iface;
2417 TRACE("(%p)->(%u, %p)\n", This, index, frame);
2420 return D3DRMERR_BADVALUE;
2424 if (index >= This->size)
2425 return D3DRMERR_BADVALUE;
2427 IDirect3DRMFrame_AddRef(This->frames[index]);
2428 *frame = This->frames[index];
2433 static const struct IDirect3DRMFrameArrayVtbl Direct3DRMFrameArray_Vtbl =
2435 /*** IUnknown methods ***/
2436 IDirect3DRMFrameArrayImpl_QueryInterface,
2437 IDirect3DRMFrameArrayImpl_AddRef,
2438 IDirect3DRMFrameArrayImpl_Release,
2439 /*** IDirect3DRMArray methods ***/
2440 IDirect3DRMFrameArrayImpl_GetSize,
2441 /*** IDirect3DRMFrameArray methods ***/
2442 IDirect3DRMFrameArrayImpl_GetElement
2445 HRESULT Direct3DRMFrameArray_create(IDirect3DRMFrameArray** obj)
2447 IDirect3DRMFrameArrayImpl* object;
2449 TRACE("(%p)\n", obj);
2453 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMFrameArrayImpl));
2456 ERR("Out of memory\n");
2457 return E_OUTOFMEMORY;
2460 object->IDirect3DRMFrameArray_iface.lpVtbl = &Direct3DRMFrameArray_Vtbl;
2463 *obj = &object->IDirect3DRMFrameArray_iface;
2468 /*** IUnknown methods ***/
2469 static HRESULT WINAPI IDirect3DRMVisualArrayImpl_QueryInterface(IDirect3DRMVisualArray* iface,
2470 REFIID riid, void** ret_iface)
2472 TRACE("(%p)->(%s, %p)\n", iface, debugstr_guid(riid), ret_iface);
2474 if (IsEqualGUID(riid, &IID_IUnknown) ||
2475 IsEqualGUID(riid, &IID_IDirect3DRMFrameArray))
2478 IDirect3DRMVisualArray_AddRef(iface);
2484 WARN("Interface %s not implemented\n", debugstr_guid(riid));
2486 return E_NOINTERFACE;
2489 static ULONG WINAPI IDirect3DRMVisualArrayImpl_AddRef(IDirect3DRMVisualArray* iface)
2491 IDirect3DRMVisualArrayImpl *This = (IDirect3DRMVisualArrayImpl*)iface;
2492 ULONG ref = InterlockedIncrement(&This->ref);
2494 TRACE("(%p)->(): new ref = %u\n", iface, ref);
2499 static ULONG WINAPI IDirect3DRMVisualArrayImpl_Release(IDirect3DRMVisualArray* iface)
2501 IDirect3DRMVisualArrayImpl *This = (IDirect3DRMVisualArrayImpl*)iface;
2502 ULONG ref = InterlockedDecrement(&This->ref);
2505 TRACE("(%p)->(): new ref = %u\n", iface, ref);
2509 for (i = 0; i < This->size; i++)
2510 IDirect3DRMVisual_Release(This->visuals[i]);
2511 HeapFree(GetProcessHeap(), 0, This->visuals);
2512 HeapFree(GetProcessHeap(), 0, This);
2518 /*** IDirect3DRMArray methods ***/
2519 static DWORD WINAPI IDirect3DRMVisualArrayImpl_GetSize(IDirect3DRMVisualArray* iface)
2521 IDirect3DRMVisualArrayImpl *This = (IDirect3DRMVisualArrayImpl*)iface;
2523 TRACE("(%p)->() = %d\n", iface, This->size);
2528 /*** IDirect3DRMVisualArray methods ***/
2529 static HRESULT WINAPI IDirect3DRMVisualArrayImpl_GetElement(IDirect3DRMVisualArray* iface, DWORD index, LPDIRECT3DRMVISUAL* visual)
2531 IDirect3DRMVisualArrayImpl *This = (IDirect3DRMVisualArrayImpl*)iface;
2533 TRACE("(%p)->(%u, %p)\n", iface, index, visual);
2536 return D3DRMERR_BADVALUE;
2540 if (index >= This->size)
2541 return D3DRMERR_BADVALUE;
2543 IDirect3DRMVisual_AddRef(This->visuals[index]);
2544 *visual = This->visuals[index];
2549 static const struct IDirect3DRMVisualArrayVtbl Direct3DRMVisualArray_Vtbl =
2551 /*** IUnknown methods ***/
2552 IDirect3DRMVisualArrayImpl_QueryInterface,
2553 IDirect3DRMVisualArrayImpl_AddRef,
2554 IDirect3DRMVisualArrayImpl_Release,
2555 /*** IDirect3DRMArray methods ***/
2556 IDirect3DRMVisualArrayImpl_GetSize,
2557 /*** IDirect3DRMVisualArray methods ***/
2558 IDirect3DRMVisualArrayImpl_GetElement
2561 HRESULT Direct3DRMVisualArray_create(IDirect3DRMVisualArray** ret_iface)
2563 IDirect3DRMVisualArrayImpl* object;
2565 TRACE("(%p)\n", ret_iface);
2569 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMVisualArrayImpl));
2572 ERR("Out of memory\n");
2573 return E_OUTOFMEMORY;
2576 object->IDirect3DRMVisualArray_iface.lpVtbl = &Direct3DRMVisualArray_Vtbl;
2579 *ret_iface = &object->IDirect3DRMVisualArray_iface;
2584 /*** IUnknown methods ***/
2585 static HRESULT WINAPI IDirect3DRMLightArrayImpl_QueryInterface(IDirect3DRMLightArray* iface,
2586 REFIID riid, void** object)
2588 IDirect3DRMLightArrayImpl *This = impl_from_IDirect3DRMLightArray(iface);
2590 TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
2594 if (IsEqualGUID(riid, &IID_IUnknown) ||
2595 IsEqualGUID(riid, &IID_IDirect3DRMLightArray))
2597 *object = &This->IDirect3DRMLightArray_iface;
2601 FIXME("interface %s not implemented\n", debugstr_guid(riid));
2602 return E_NOINTERFACE;
2605 IDirect3DRMLightArray_AddRef(iface);
2609 static ULONG WINAPI IDirect3DRMLightArrayImpl_AddRef(IDirect3DRMLightArray* iface)
2611 IDirect3DRMLightArrayImpl *This = impl_from_IDirect3DRMLightArray(iface);
2612 ULONG ref = InterlockedIncrement(&This->ref);
2614 TRACE("(%p)->(): new ref = %u\n", This, ref);
2619 static ULONG WINAPI IDirect3DRMLightArrayImpl_Release(IDirect3DRMLightArray* iface)
2621 IDirect3DRMLightArrayImpl *This = impl_from_IDirect3DRMLightArray(iface);
2622 ULONG ref = InterlockedDecrement(&This->ref);
2625 TRACE("(%p)->(): new ref = %u\n", This, ref);
2629 for (i = 0; i < This->size; i++)
2630 IDirect3DRMLight_Release(This->lights[i]);
2631 HeapFree(GetProcessHeap(), 0, This->lights);
2632 HeapFree(GetProcessHeap(), 0, This);
2638 /*** IDirect3DRMArray methods ***/
2639 static DWORD WINAPI IDirect3DRMLightArrayImpl_GetSize(IDirect3DRMLightArray* iface)
2641 IDirect3DRMLightArrayImpl *This = impl_from_IDirect3DRMLightArray(iface);
2643 TRACE("(%p)->() = %d\n", This, This->size);
2648 /*** IDirect3DRMLightArray methods ***/
2649 static HRESULT WINAPI IDirect3DRMLightArrayImpl_GetElement(IDirect3DRMLightArray* iface, DWORD index, LPDIRECT3DRMLIGHT* light)
2651 IDirect3DRMLightArrayImpl *This = impl_from_IDirect3DRMLightArray(iface);
2653 TRACE("(%p)->(%u, %p)\n", This, index, light);
2656 return D3DRMERR_BADVALUE;
2660 if (index >= This->size)
2661 return D3DRMERR_BADVALUE;
2663 IDirect3DRMLight_AddRef(This->lights[index]);
2664 *light = This->lights[index];
2669 static const struct IDirect3DRMLightArrayVtbl Direct3DRMLightArray_Vtbl =
2671 /*** IUnknown methods ***/
2672 IDirect3DRMLightArrayImpl_QueryInterface,
2673 IDirect3DRMLightArrayImpl_AddRef,
2674 IDirect3DRMLightArrayImpl_Release,
2675 /*** IDirect3DRMArray methods ***/
2676 IDirect3DRMLightArrayImpl_GetSize,
2677 /*** IDirect3DRMLightArray methods ***/
2678 IDirect3DRMLightArrayImpl_GetElement
2681 HRESULT Direct3DRMLightArray_create(IDirect3DRMLightArray** obj)
2683 IDirect3DRMLightArrayImpl* object;
2685 TRACE("(%p)\n", obj);
2689 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMLightArrayImpl));
2692 ERR("Out of memory\n");
2693 return E_OUTOFMEMORY;
2696 object->IDirect3DRMLightArray_iface.lpVtbl = &Direct3DRMLightArray_Vtbl;
2699 *obj = &object->IDirect3DRMLightArray_iface;