1c2c66affSColin Finck /*
2c2c66affSColin Finck * Implementation of IDirect3DRMLight Interface
3c2c66affSColin Finck *
4c2c66affSColin Finck * Copyright 2012 André Hentschel
5c2c66affSColin Finck *
6c2c66affSColin Finck * This library is free software; you can redistribute it and/or
7c2c66affSColin Finck * modify it under the terms of the GNU Lesser General Public
8c2c66affSColin Finck * License as published by the Free Software Foundation; either
9c2c66affSColin Finck * version 2.1 of the License, or (at your option) any later version.
10c2c66affSColin Finck *
11c2c66affSColin Finck * This library is distributed in the hope that it will be useful,
12c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
13c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14c2c66affSColin Finck * Lesser General Public License for more details.
15c2c66affSColin Finck *
16c2c66affSColin Finck * You should have received a copy of the GNU Lesser General Public
17c2c66affSColin Finck * License along with this library; if not, write to the Free Software
18c2c66affSColin Finck * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
19c2c66affSColin Finck */
20c2c66affSColin Finck
21c2c66affSColin Finck #include "d3drm_private.h"
22c2c66affSColin Finck
23*e792c304SAmine Khaldi WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
24*e792c304SAmine Khaldi
impl_from_IDirect3DRMLight(IDirect3DRMLight * iface)25c2c66affSColin Finck static inline struct d3drm_light *impl_from_IDirect3DRMLight(IDirect3DRMLight *iface)
26c2c66affSColin Finck {
27c2c66affSColin Finck return CONTAINING_RECORD(iface, struct d3drm_light, IDirect3DRMLight_iface);
28c2c66affSColin Finck }
29c2c66affSColin Finck
d3drm_light_QueryInterface(IDirect3DRMLight * iface,REFIID riid,void ** out)30c2c66affSColin Finck static HRESULT WINAPI d3drm_light_QueryInterface(IDirect3DRMLight *iface, REFIID riid, void **out)
31c2c66affSColin Finck {
32c2c66affSColin Finck TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
33c2c66affSColin Finck
34c2c66affSColin Finck if (IsEqualGUID(riid, &IID_IDirect3DRMLight)
35c2c66affSColin Finck || IsEqualGUID(riid, &IID_IDirect3DRMObject)
36c2c66affSColin Finck || IsEqualGUID(riid, &IID_IUnknown))
37c2c66affSColin Finck {
38c2c66affSColin Finck IDirect3DRMLight_AddRef(iface);
39c2c66affSColin Finck *out = iface;
40c2c66affSColin Finck return S_OK;
41c2c66affSColin Finck }
42c2c66affSColin Finck
43c2c66affSColin Finck WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
44c2c66affSColin Finck
45c2c66affSColin Finck *out = NULL;
46c2c66affSColin Finck return E_NOINTERFACE;
47c2c66affSColin Finck }
48c2c66affSColin Finck
d3drm_light_AddRef(IDirect3DRMLight * iface)49c2c66affSColin Finck static ULONG WINAPI d3drm_light_AddRef(IDirect3DRMLight *iface)
50c2c66affSColin Finck {
51c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
52c2c66affSColin Finck ULONG refcount = InterlockedIncrement(&light->ref);
53c2c66affSColin Finck
54c2c66affSColin Finck TRACE("%p increasing refcount to %u.\n", iface, refcount);
55c2c66affSColin Finck
56c2c66affSColin Finck return refcount;
57c2c66affSColin Finck }
58c2c66affSColin Finck
d3drm_light_Release(IDirect3DRMLight * iface)59c2c66affSColin Finck static ULONG WINAPI d3drm_light_Release(IDirect3DRMLight *iface)
60c2c66affSColin Finck {
61c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
62c2c66affSColin Finck ULONG refcount = InterlockedDecrement(&light->ref);
63c2c66affSColin Finck
64c2c66affSColin Finck TRACE("%p decreasing refcount to %u.\n", iface, refcount);
65c2c66affSColin Finck
66c2c66affSColin Finck if (!refcount)
67c2c66affSColin Finck {
68c2c66affSColin Finck d3drm_object_cleanup((IDirect3DRMObject *)iface, &light->obj);
69c2c66affSColin Finck IDirect3DRM_Release(light->d3drm);
70*e792c304SAmine Khaldi heap_free(light);
71c2c66affSColin Finck }
72c2c66affSColin Finck
73c2c66affSColin Finck return refcount;
74c2c66affSColin Finck }
75c2c66affSColin Finck
d3drm_light_Clone(IDirect3DRMLight * iface,IUnknown * outer,REFIID iid,void ** out)76c2c66affSColin Finck static HRESULT WINAPI d3drm_light_Clone(IDirect3DRMLight *iface,
77c2c66affSColin Finck IUnknown *outer, REFIID iid, void **out)
78c2c66affSColin Finck {
79c2c66affSColin Finck FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
80c2c66affSColin Finck
81c2c66affSColin Finck return E_NOTIMPL;
82c2c66affSColin Finck }
83c2c66affSColin Finck
d3drm_light_AddDestroyCallback(IDirect3DRMLight * iface,D3DRMOBJECTCALLBACK cb,void * ctx)84c2c66affSColin Finck static HRESULT WINAPI d3drm_light_AddDestroyCallback(IDirect3DRMLight *iface,
85c2c66affSColin Finck D3DRMOBJECTCALLBACK cb, void *ctx)
86c2c66affSColin Finck {
87c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
88c2c66affSColin Finck
89c2c66affSColin Finck TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
90c2c66affSColin Finck
91c2c66affSColin Finck return d3drm_object_add_destroy_callback(&light->obj, cb, ctx);
92c2c66affSColin Finck }
93c2c66affSColin Finck
d3drm_light_DeleteDestroyCallback(IDirect3DRMLight * iface,D3DRMOBJECTCALLBACK cb,void * ctx)94c2c66affSColin Finck static HRESULT WINAPI d3drm_light_DeleteDestroyCallback(IDirect3DRMLight *iface,
95c2c66affSColin Finck D3DRMOBJECTCALLBACK cb, void *ctx)
96c2c66affSColin Finck {
97c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
98c2c66affSColin Finck
99c2c66affSColin Finck TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
100c2c66affSColin Finck
101c2c66affSColin Finck return d3drm_object_delete_destroy_callback(&light->obj, cb, ctx);
102c2c66affSColin Finck }
103c2c66affSColin Finck
d3drm_light_SetAppData(IDirect3DRMLight * iface,DWORD data)104c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetAppData(IDirect3DRMLight *iface, DWORD data)
105c2c66affSColin Finck {
106c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
107c2c66affSColin Finck
108c2c66affSColin Finck TRACE("iface %p, data %#x.\n", iface, data);
109c2c66affSColin Finck
110c2c66affSColin Finck light->obj.appdata = data;
111c2c66affSColin Finck
112c2c66affSColin Finck return D3DRM_OK;
113c2c66affSColin Finck }
114c2c66affSColin Finck
d3drm_light_GetAppData(IDirect3DRMLight * iface)115c2c66affSColin Finck static DWORD WINAPI d3drm_light_GetAppData(IDirect3DRMLight *iface)
116c2c66affSColin Finck {
117c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
118c2c66affSColin Finck
119c2c66affSColin Finck TRACE("iface %p.\n", iface);
120c2c66affSColin Finck
121c2c66affSColin Finck return light->obj.appdata;
122c2c66affSColin Finck }
123c2c66affSColin Finck
d3drm_light_SetName(IDirect3DRMLight * iface,const char * name)124c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetName(IDirect3DRMLight *iface, const char *name)
125c2c66affSColin Finck {
126c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
127c2c66affSColin Finck
128c2c66affSColin Finck TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
129c2c66affSColin Finck
130c2c66affSColin Finck return d3drm_object_set_name(&light->obj, name);
131c2c66affSColin Finck }
132c2c66affSColin Finck
d3drm_light_GetName(IDirect3DRMLight * iface,DWORD * size,char * name)133c2c66affSColin Finck static HRESULT WINAPI d3drm_light_GetName(IDirect3DRMLight *iface, DWORD *size, char *name)
134c2c66affSColin Finck {
135c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
136c2c66affSColin Finck
137c2c66affSColin Finck TRACE("iface %p, size %p, name %p.\n", iface, size, name);
138c2c66affSColin Finck
139c2c66affSColin Finck return d3drm_object_get_name(&light->obj, size, name);
140c2c66affSColin Finck }
141c2c66affSColin Finck
d3drm_light_GetClassName(IDirect3DRMLight * iface,DWORD * size,char * name)142c2c66affSColin Finck static HRESULT WINAPI d3drm_light_GetClassName(IDirect3DRMLight *iface, DWORD *size, char *name)
143c2c66affSColin Finck {
144c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
145c2c66affSColin Finck
146c2c66affSColin Finck TRACE("iface %p, size %p, name %p.\n", iface, size, name);
147c2c66affSColin Finck
148c2c66affSColin Finck return d3drm_object_get_class_name(&light->obj, size, name);
149c2c66affSColin Finck }
150c2c66affSColin Finck
d3drm_light_SetType(IDirect3DRMLight * iface,D3DRMLIGHTTYPE type)151c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetType(IDirect3DRMLight *iface, D3DRMLIGHTTYPE type)
152c2c66affSColin Finck {
153c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
154c2c66affSColin Finck
155c2c66affSColin Finck TRACE("iface %p, type %#x.\n", iface, type);
156c2c66affSColin Finck
157c2c66affSColin Finck light->type = type;
158c2c66affSColin Finck
159c2c66affSColin Finck return D3DRM_OK;
160c2c66affSColin Finck }
161c2c66affSColin Finck
d3drm_light_SetColor(IDirect3DRMLight * iface,D3DCOLOR color)162c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetColor(IDirect3DRMLight *iface, D3DCOLOR color)
163c2c66affSColin Finck {
164c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
165c2c66affSColin Finck
166c2c66affSColin Finck TRACE("iface %p, color 0x%08x.\n", iface, color);
167c2c66affSColin Finck
168c2c66affSColin Finck light->color = color;
169c2c66affSColin Finck
170c2c66affSColin Finck return D3DRM_OK;
171c2c66affSColin Finck }
172c2c66affSColin Finck
d3drm_light_SetColorRGB(IDirect3DRMLight * iface,D3DVALUE red,D3DVALUE green,D3DVALUE blue)173c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetColorRGB(IDirect3DRMLight *iface,
174c2c66affSColin Finck D3DVALUE red, D3DVALUE green, D3DVALUE blue)
175c2c66affSColin Finck {
176c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
177c2c66affSColin Finck
178c2c66affSColin Finck TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
179c2c66affSColin Finck
180c2c66affSColin Finck d3drm_set_color(&light->color, red, green, blue, 1.0f);
181c2c66affSColin Finck
182c2c66affSColin Finck return D3DRM_OK;
183c2c66affSColin Finck }
184c2c66affSColin Finck
d3drm_light_SetRange(IDirect3DRMLight * iface,D3DVALUE range)185c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetRange(IDirect3DRMLight *iface, D3DVALUE range)
186c2c66affSColin Finck {
187c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
188c2c66affSColin Finck
189c2c66affSColin Finck TRACE("iface %p, range %.8e.\n", iface, range);
190c2c66affSColin Finck
191c2c66affSColin Finck light->range = range;
192c2c66affSColin Finck
193c2c66affSColin Finck return D3DRM_OK;
194c2c66affSColin Finck }
195c2c66affSColin Finck
d3drm_light_SetUmbra(IDirect3DRMLight * iface,D3DVALUE umbra)196c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetUmbra(IDirect3DRMLight *iface, D3DVALUE umbra)
197c2c66affSColin Finck {
198c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
199c2c66affSColin Finck
200c2c66affSColin Finck TRACE("iface %p, umbra %.8e.\n", iface, umbra);
201c2c66affSColin Finck
202c2c66affSColin Finck light->umbra = umbra;
203c2c66affSColin Finck
204c2c66affSColin Finck return D3DRM_OK;
205c2c66affSColin Finck }
206c2c66affSColin Finck
d3drm_light_SetPenumbra(IDirect3DRMLight * iface,D3DVALUE penumbra)207c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetPenumbra(IDirect3DRMLight *iface, D3DVALUE penumbra)
208c2c66affSColin Finck {
209c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
210c2c66affSColin Finck
211c2c66affSColin Finck TRACE("iface %p, penumbra %.8e.\n", iface, penumbra);
212c2c66affSColin Finck
213c2c66affSColin Finck light->penumbra = penumbra;
214c2c66affSColin Finck
215c2c66affSColin Finck return D3DRM_OK;
216c2c66affSColin Finck }
217c2c66affSColin Finck
d3drm_light_SetConstantAttenuation(IDirect3DRMLight * iface,D3DVALUE attenuation)218c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetConstantAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation)
219c2c66affSColin Finck {
220c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
221c2c66affSColin Finck
222c2c66affSColin Finck TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
223c2c66affSColin Finck
224c2c66affSColin Finck light->cattenuation = attenuation;
225c2c66affSColin Finck
226c2c66affSColin Finck return D3DRM_OK;
227c2c66affSColin Finck }
228c2c66affSColin Finck
d3drm_light_SetLinearAttenuation(IDirect3DRMLight * iface,D3DVALUE attenuation)229c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetLinearAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation)
230c2c66affSColin Finck {
231c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
232c2c66affSColin Finck
233c2c66affSColin Finck TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
234c2c66affSColin Finck
235c2c66affSColin Finck light->lattenuation = attenuation;
236c2c66affSColin Finck
237c2c66affSColin Finck return D3DRM_OK;
238c2c66affSColin Finck }
239c2c66affSColin Finck
d3drm_light_SetQuadraticAttenuation(IDirect3DRMLight * iface,D3DVALUE attenuation)240c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetQuadraticAttenuation(IDirect3DRMLight *iface, D3DVALUE attenuation)
241c2c66affSColin Finck {
242c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
243c2c66affSColin Finck
244c2c66affSColin Finck TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
245c2c66affSColin Finck
246c2c66affSColin Finck light->qattenuation = attenuation;
247c2c66affSColin Finck
248c2c66affSColin Finck return D3DRM_OK;
249c2c66affSColin Finck }
250c2c66affSColin Finck
d3drm_light_GetRange(IDirect3DRMLight * iface)251c2c66affSColin Finck static D3DVALUE WINAPI d3drm_light_GetRange(IDirect3DRMLight *iface)
252c2c66affSColin Finck {
253c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
254c2c66affSColin Finck
255c2c66affSColin Finck TRACE("iface %p.\n", iface);
256c2c66affSColin Finck
257c2c66affSColin Finck return light->range;
258c2c66affSColin Finck }
259c2c66affSColin Finck
d3drm_light_GetUmbra(IDirect3DRMLight * iface)260c2c66affSColin Finck static D3DVALUE WINAPI d3drm_light_GetUmbra(IDirect3DRMLight *iface)
261c2c66affSColin Finck {
262c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
263c2c66affSColin Finck
264c2c66affSColin Finck TRACE("iface %p.\n", light);
265c2c66affSColin Finck
266c2c66affSColin Finck return light->umbra;
267c2c66affSColin Finck }
268c2c66affSColin Finck
d3drm_light_GetPenumbra(IDirect3DRMLight * iface)269c2c66affSColin Finck static D3DVALUE WINAPI d3drm_light_GetPenumbra(IDirect3DRMLight *iface)
270c2c66affSColin Finck {
271c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
272c2c66affSColin Finck
273c2c66affSColin Finck TRACE("iface %p.\n", iface);
274c2c66affSColin Finck
275c2c66affSColin Finck return light->penumbra;
276c2c66affSColin Finck }
277c2c66affSColin Finck
d3drm_light_GetConstantAttenuation(IDirect3DRMLight * iface)278c2c66affSColin Finck static D3DVALUE WINAPI d3drm_light_GetConstantAttenuation(IDirect3DRMLight *iface)
279c2c66affSColin Finck {
280c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
281c2c66affSColin Finck
282c2c66affSColin Finck TRACE("iface %p.\n", iface);
283c2c66affSColin Finck
284c2c66affSColin Finck return light->cattenuation;
285c2c66affSColin Finck }
286c2c66affSColin Finck
d3drm_light_GetLinearAttenuation(IDirect3DRMLight * iface)287c2c66affSColin Finck static D3DVALUE WINAPI d3drm_light_GetLinearAttenuation(IDirect3DRMLight *iface)
288c2c66affSColin Finck {
289c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
290c2c66affSColin Finck
291c2c66affSColin Finck TRACE("iface %p.\n", iface);
292c2c66affSColin Finck
293c2c66affSColin Finck return light->lattenuation;
294c2c66affSColin Finck }
295c2c66affSColin Finck
d3drm_light_GetQuadraticAttenuation(IDirect3DRMLight * iface)296c2c66affSColin Finck static D3DVALUE WINAPI d3drm_light_GetQuadraticAttenuation(IDirect3DRMLight *iface)
297c2c66affSColin Finck {
298c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
299c2c66affSColin Finck
300c2c66affSColin Finck TRACE("iface %p.\n", iface);
301c2c66affSColin Finck
302c2c66affSColin Finck return light->qattenuation;
303c2c66affSColin Finck }
304c2c66affSColin Finck
d3drm_light_GetColor(IDirect3DRMLight * iface)305c2c66affSColin Finck static D3DCOLOR WINAPI d3drm_light_GetColor(IDirect3DRMLight *iface)
306c2c66affSColin Finck {
307c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
308c2c66affSColin Finck
309c2c66affSColin Finck TRACE("iface %p.\n", iface);
310c2c66affSColin Finck
311c2c66affSColin Finck return light->color;
312c2c66affSColin Finck }
313c2c66affSColin Finck
d3drm_light_GetType(IDirect3DRMLight * iface)314c2c66affSColin Finck static D3DRMLIGHTTYPE WINAPI d3drm_light_GetType(IDirect3DRMLight *iface)
315c2c66affSColin Finck {
316c2c66affSColin Finck struct d3drm_light *light = impl_from_IDirect3DRMLight(iface);
317c2c66affSColin Finck
318c2c66affSColin Finck TRACE("iface %p.\n", iface);
319c2c66affSColin Finck
320c2c66affSColin Finck return light->type;
321c2c66affSColin Finck }
322c2c66affSColin Finck
d3drm_light_SetEnableFrame(IDirect3DRMLight * iface,IDirect3DRMFrame * frame)323c2c66affSColin Finck static HRESULT WINAPI d3drm_light_SetEnableFrame(IDirect3DRMLight *iface, IDirect3DRMFrame *frame)
324c2c66affSColin Finck {
325c2c66affSColin Finck FIXME("iface %p, frame %p stub!\n", iface, frame);
326c2c66affSColin Finck
327c2c66affSColin Finck return E_NOTIMPL;
328c2c66affSColin Finck }
329c2c66affSColin Finck
d3drm_light_GetEnableFrame(IDirect3DRMLight * iface,IDirect3DRMFrame ** frame)330c2c66affSColin Finck static HRESULT WINAPI d3drm_light_GetEnableFrame(IDirect3DRMLight *iface, IDirect3DRMFrame **frame)
331c2c66affSColin Finck {
332c2c66affSColin Finck FIXME("iface %p, frame %p stub!\n", iface, frame);
333c2c66affSColin Finck
334c2c66affSColin Finck return E_NOTIMPL;
335c2c66affSColin Finck }
336c2c66affSColin Finck
337c2c66affSColin Finck static const struct IDirect3DRMLightVtbl d3drm_light_vtbl =
338c2c66affSColin Finck {
339c2c66affSColin Finck d3drm_light_QueryInterface,
340c2c66affSColin Finck d3drm_light_AddRef,
341c2c66affSColin Finck d3drm_light_Release,
342c2c66affSColin Finck d3drm_light_Clone,
343c2c66affSColin Finck d3drm_light_AddDestroyCallback,
344c2c66affSColin Finck d3drm_light_DeleteDestroyCallback,
345c2c66affSColin Finck d3drm_light_SetAppData,
346c2c66affSColin Finck d3drm_light_GetAppData,
347c2c66affSColin Finck d3drm_light_SetName,
348c2c66affSColin Finck d3drm_light_GetName,
349c2c66affSColin Finck d3drm_light_GetClassName,
350c2c66affSColin Finck d3drm_light_SetType,
351c2c66affSColin Finck d3drm_light_SetColor,
352c2c66affSColin Finck d3drm_light_SetColorRGB,
353c2c66affSColin Finck d3drm_light_SetRange,
354c2c66affSColin Finck d3drm_light_SetUmbra,
355c2c66affSColin Finck d3drm_light_SetPenumbra,
356c2c66affSColin Finck d3drm_light_SetConstantAttenuation,
357c2c66affSColin Finck d3drm_light_SetLinearAttenuation,
358c2c66affSColin Finck d3drm_light_SetQuadraticAttenuation,
359c2c66affSColin Finck d3drm_light_GetRange,
360c2c66affSColin Finck d3drm_light_GetUmbra,
361c2c66affSColin Finck d3drm_light_GetPenumbra,
362c2c66affSColin Finck d3drm_light_GetConstantAttenuation,
363c2c66affSColin Finck d3drm_light_GetLinearAttenuation,
364c2c66affSColin Finck d3drm_light_GetQuadraticAttenuation,
365c2c66affSColin Finck d3drm_light_GetColor,
366c2c66affSColin Finck d3drm_light_GetType,
367c2c66affSColin Finck d3drm_light_SetEnableFrame,
368c2c66affSColin Finck d3drm_light_GetEnableFrame,
369c2c66affSColin Finck };
370c2c66affSColin Finck
d3drm_light_create(struct d3drm_light ** light,IDirect3DRM * d3drm)371c2c66affSColin Finck HRESULT d3drm_light_create(struct d3drm_light **light, IDirect3DRM *d3drm)
372c2c66affSColin Finck {
373c2c66affSColin Finck static const char classname[] = "Light";
374c2c66affSColin Finck struct d3drm_light *object;
375c2c66affSColin Finck
376c2c66affSColin Finck TRACE("light %p.\n", light);
377c2c66affSColin Finck
378*e792c304SAmine Khaldi if (!(object = heap_alloc_zero(sizeof(*object))))
379c2c66affSColin Finck return E_OUTOFMEMORY;
380c2c66affSColin Finck
381c2c66affSColin Finck object->IDirect3DRMLight_iface.lpVtbl = &d3drm_light_vtbl;
382c2c66affSColin Finck object->ref = 1;
383c2c66affSColin Finck object->d3drm = d3drm;
384c2c66affSColin Finck IDirect3DRM_AddRef(object->d3drm);
385c2c66affSColin Finck
386c2c66affSColin Finck d3drm_object_init(&object->obj, classname);
387c2c66affSColin Finck
388c2c66affSColin Finck *light = object;
389c2c66affSColin Finck
390c2c66affSColin Finck return S_OK;
391c2c66affSColin Finck }
392