ReactOS 0.4.15-dev-8102-g108db8f
light.c File Reference
#include "d3drm_private.h"
Include dependency graph for light.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (d3drm)
 
static struct d3drm_lightimpl_from_IDirect3DRMLight (IDirect3DRMLight *iface)
 
static HRESULT WINAPI d3drm_light_QueryInterface (IDirect3DRMLight *iface, REFIID riid, void **out)
 
static ULONG WINAPI d3drm_light_AddRef (IDirect3DRMLight *iface)
 
static ULONG WINAPI d3drm_light_Release (IDirect3DRMLight *iface)
 
static HRESULT WINAPI d3drm_light_Clone (IDirect3DRMLight *iface, IUnknown *outer, REFIID iid, void **out)
 
static HRESULT WINAPI d3drm_light_AddDestroyCallback (IDirect3DRMLight *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_light_DeleteDestroyCallback (IDirect3DRMLight *iface, D3DRMOBJECTCALLBACK cb, void *ctx)
 
static HRESULT WINAPI d3drm_light_SetAppData (IDirect3DRMLight *iface, DWORD data)
 
static DWORD WINAPI d3drm_light_GetAppData (IDirect3DRMLight *iface)
 
static HRESULT WINAPI d3drm_light_SetName (IDirect3DRMLight *iface, const char *name)
 
static HRESULT WINAPI d3drm_light_GetName (IDirect3DRMLight *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_light_GetClassName (IDirect3DRMLight *iface, DWORD *size, char *name)
 
static HRESULT WINAPI d3drm_light_SetType (IDirect3DRMLight *iface, D3DRMLIGHTTYPE type)
 
static HRESULT WINAPI d3drm_light_SetColor (IDirect3DRMLight *iface, D3DCOLOR color)
 
static HRESULT WINAPI d3drm_light_SetColorRGB (IDirect3DRMLight *iface, D3DVALUE red, D3DVALUE green, D3DVALUE blue)
 
static HRESULT WINAPI d3drm_light_SetRange (IDirect3DRMLight *iface, D3DVALUE range)
 
static HRESULT WINAPI d3drm_light_SetUmbra (IDirect3DRMLight *iface, D3DVALUE umbra)
 
static HRESULT WINAPI d3drm_light_SetPenumbra (IDirect3DRMLight *iface, D3DVALUE penumbra)
 
static HRESULT WINAPI d3drm_light_SetConstantAttenuation (IDirect3DRMLight *iface, D3DVALUE attenuation)
 
static HRESULT WINAPI d3drm_light_SetLinearAttenuation (IDirect3DRMLight *iface, D3DVALUE attenuation)
 
static HRESULT WINAPI d3drm_light_SetQuadraticAttenuation (IDirect3DRMLight *iface, D3DVALUE attenuation)
 
static D3DVALUE WINAPI d3drm_light_GetRange (IDirect3DRMLight *iface)
 
static D3DVALUE WINAPI d3drm_light_GetUmbra (IDirect3DRMLight *iface)
 
static D3DVALUE WINAPI d3drm_light_GetPenumbra (IDirect3DRMLight *iface)
 
static D3DVALUE WINAPI d3drm_light_GetConstantAttenuation (IDirect3DRMLight *iface)
 
static D3DVALUE WINAPI d3drm_light_GetLinearAttenuation (IDirect3DRMLight *iface)
 
static D3DVALUE WINAPI d3drm_light_GetQuadraticAttenuation (IDirect3DRMLight *iface)
 
static D3DCOLOR WINAPI d3drm_light_GetColor (IDirect3DRMLight *iface)
 
static D3DRMLIGHTTYPE WINAPI d3drm_light_GetType (IDirect3DRMLight *iface)
 
static HRESULT WINAPI d3drm_light_SetEnableFrame (IDirect3DRMLight *iface, IDirect3DRMFrame *frame)
 
static HRESULT WINAPI d3drm_light_GetEnableFrame (IDirect3DRMLight *iface, IDirect3DRMFrame **frame)
 
HRESULT d3drm_light_create (struct d3drm_light **light, IDirect3DRM *d3drm)
 

Variables

static const struct IDirect3DRMLightVtbl d3drm_light_vtbl
 

Function Documentation

◆ d3drm_light_AddDestroyCallback()

static HRESULT WINAPI d3drm_light_AddDestroyCallback ( IDirect3DRMLight *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 84 of file light.c.

86{
88
89 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
90
92}
HRESULT d3drm_object_add_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:55
static struct d3drm_light * impl_from_IDirect3DRMLight(IDirect3DRMLight *iface)
Definition: light.c:25
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum light
Definition: glfuncs.h:170
static HMODULE MODULEINFO DWORD cb
Definition: module.c:33
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3drm_light_AddRef()

static ULONG WINAPI d3drm_light_AddRef ( IDirect3DRMLight *  iface)
static

Definition at line 49 of file light.c.

50{
52 ULONG refcount = InterlockedIncrement(&light->ref);
53
54 TRACE("%p increasing refcount to %u.\n", iface, refcount);
55
56 return refcount;
57}
#define InterlockedIncrement
Definition: armddk.h:53
uint32_t ULONG
Definition: typedefs.h:59

◆ d3drm_light_Clone()

static HRESULT WINAPI d3drm_light_Clone ( IDirect3DRMLight *  iface,
IUnknown outer,
REFIID  iid,
void **  out 
)
static

Definition at line 76 of file light.c.

78{
79 FIXME("iface %p, outer %p, iid %s, out %p stub!\n", iface, outer, debugstr_guid(iid), out);
80
81 return E_NOTIMPL;
82}
#define FIXME(fmt,...)
Definition: debug.h:114
#define E_NOTIMPL
Definition: ddrawi.h:99
#define debugstr_guid
Definition: kernel32.h:35
static FILE * out
Definition: regtests2xml.c:44

◆ d3drm_light_create()

HRESULT d3drm_light_create ( struct d3drm_light **  light,
IDirect3DRM *  d3drm 
)

Definition at line 371 of file light.c.

372{
373 static const char classname[] = "Light";
374 struct d3drm_light *object;
375
376 TRACE("light %p.\n", light);
377
378 if (!(object = heap_alloc_zero(sizeof(*object))))
379 return E_OUTOFMEMORY;
380
381 object->IDirect3DRMLight_iface.lpVtbl = &d3drm_light_vtbl;
382 object->ref = 1;
383 object->d3drm = d3drm;
385
387
388 *light = object;
389
390 return S_OK;
391}
#define IDirect3DRM_AddRef(p)
Definition: d3drm.h:110
void d3drm_object_init(struct d3drm_object *object, const char *classname)
Definition: d3drm_main.c:39
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const struct IDirect3DRMLightVtbl d3drm_light_vtbl
Definition: light.c:337
#define S_OK
Definition: intsafe.h:52
WCHAR classname[128]
Definition: startup.c:15
IDirect3DRM * d3drm

Referenced by d3drm3_CreateLight(), d3drm3_CreateLightRGB(), and d3drm_create_light_object().

◆ d3drm_light_DeleteDestroyCallback()

static HRESULT WINAPI d3drm_light_DeleteDestroyCallback ( IDirect3DRMLight *  iface,
D3DRMOBJECTCALLBACK  cb,
void ctx 
)
static

Definition at line 94 of file light.c.

96{
98
99 TRACE("iface %p, cb %p, ctx %p.\n", iface, cb, ctx);
100
102}
HRESULT d3drm_object_delete_destroy_callback(struct d3drm_object *object, D3DRMOBJECTCALLBACK cb, void *ctx)
Definition: d3drm_main.c:72

◆ d3drm_light_GetAppData()

static DWORD WINAPI d3drm_light_GetAppData ( IDirect3DRMLight *  iface)
static

Definition at line 115 of file light.c.

116{
118
119 TRACE("iface %p.\n", iface);
120
121 return light->obj.appdata;
122}

◆ d3drm_light_GetClassName()

static HRESULT WINAPI d3drm_light_GetClassName ( IDirect3DRMLight *  iface,
DWORD size,
char name 
)
static

Definition at line 142 of file light.c.

143{
145
146 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
147
149}
HRESULT d3drm_object_get_class_name(struct d3drm_object *object, DWORD *size, char *name)
Definition: d3drm_main.c:92
GLsizeiptr size
Definition: glext.h:5919
Definition: name.c:39

◆ d3drm_light_GetColor()

static D3DCOLOR WINAPI d3drm_light_GetColor ( IDirect3DRMLight *  iface)
static

Definition at line 305 of file light.c.

306{
308
309 TRACE("iface %p.\n", iface);
310
311 return light->color;
312}

◆ d3drm_light_GetConstantAttenuation()

static D3DVALUE WINAPI d3drm_light_GetConstantAttenuation ( IDirect3DRMLight *  iface)
static

Definition at line 278 of file light.c.

279{
281
282 TRACE("iface %p.\n", iface);
283
284 return light->cattenuation;
285}

◆ d3drm_light_GetEnableFrame()

static HRESULT WINAPI d3drm_light_GetEnableFrame ( IDirect3DRMLight *  iface,
IDirect3DRMFrame **  frame 
)
static

Definition at line 330 of file light.c.

331{
332 FIXME("iface %p, frame %p stub!\n", iface, frame);
333
334 return E_NOTIMPL;
335}

◆ d3drm_light_GetLinearAttenuation()

static D3DVALUE WINAPI d3drm_light_GetLinearAttenuation ( IDirect3DRMLight *  iface)
static

Definition at line 287 of file light.c.

288{
290
291 TRACE("iface %p.\n", iface);
292
293 return light->lattenuation;
294}

◆ d3drm_light_GetName()

static HRESULT WINAPI d3drm_light_GetName ( IDirect3DRMLight *  iface,
DWORD size,
char name 
)
static

Definition at line 133 of file light.c.

134{
136
137 TRACE("iface %p, size %p, name %p.\n", iface, size, name);
138
139 return d3drm_object_get_name(&light->obj, size, name);
140}
HRESULT d3drm_object_get_name(struct d3drm_object *object, DWORD *size, char *name)
Definition: d3drm_main.c:111

◆ d3drm_light_GetPenumbra()

static D3DVALUE WINAPI d3drm_light_GetPenumbra ( IDirect3DRMLight *  iface)
static

Definition at line 269 of file light.c.

270{
272
273 TRACE("iface %p.\n", iface);
274
275 return light->penumbra;
276}

◆ d3drm_light_GetQuadraticAttenuation()

static D3DVALUE WINAPI d3drm_light_GetQuadraticAttenuation ( IDirect3DRMLight *  iface)
static

Definition at line 296 of file light.c.

297{
299
300 TRACE("iface %p.\n", iface);
301
302 return light->qattenuation;
303}

◆ d3drm_light_GetRange()

static D3DVALUE WINAPI d3drm_light_GetRange ( IDirect3DRMLight *  iface)
static

Definition at line 251 of file light.c.

252{
254
255 TRACE("iface %p.\n", iface);
256
257 return light->range;
258}

◆ d3drm_light_GetType()

static D3DRMLIGHTTYPE WINAPI d3drm_light_GetType ( IDirect3DRMLight *  iface)
static

Definition at line 314 of file light.c.

315{
317
318 TRACE("iface %p.\n", iface);
319
320 return light->type;
321}

◆ d3drm_light_GetUmbra()

static D3DVALUE WINAPI d3drm_light_GetUmbra ( IDirect3DRMLight *  iface)
static

Definition at line 260 of file light.c.

261{
263
264 TRACE("iface %p.\n", light);
265
266 return light->umbra;
267}

◆ d3drm_light_QueryInterface()

static HRESULT WINAPI d3drm_light_QueryInterface ( IDirect3DRMLight *  iface,
REFIID  riid,
void **  out 
)
static

Definition at line 30 of file light.c.

31{
32 TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out);
33
34 if (IsEqualGUID(riid, &IID_IDirect3DRMLight)
35 || IsEqualGUID(riid, &IID_IDirect3DRMObject)
37 {
39 *out = iface;
40 return S_OK;
41 }
42
43 WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
44
45 *out = NULL;
46 return E_NOINTERFACE;
47}
const GUID IID_IUnknown
#define WARN(fmt,...)
Definition: debug.h:115
#define IDirect3DRMLight_AddRef(p)
Definition: d3drmobj.h:3119
#define NULL
Definition: types.h:112
REFIID riid
Definition: atlbase.h:39
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ d3drm_light_Release()

static ULONG WINAPI d3drm_light_Release ( IDirect3DRMLight *  iface)
static

Definition at line 59 of file light.c.

60{
62 ULONG refcount = InterlockedDecrement(&light->ref);
63
64 TRACE("%p decreasing refcount to %u.\n", iface, refcount);
65
66 if (!refcount)
67 {
68 d3drm_object_cleanup((IDirect3DRMObject *)iface, &light->obj);
71 }
72
73 return refcount;
74}
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define InterlockedDecrement
Definition: armddk.h:52
#define IDirect3DRM_Release(p)
Definition: d3drm.h:111
void d3drm_object_cleanup(IDirect3DRMObject *iface, struct d3drm_object *object)
Definition: d3drm_main.c:153

◆ d3drm_light_SetAppData()

static HRESULT WINAPI d3drm_light_SetAppData ( IDirect3DRMLight *  iface,
DWORD  data 
)
static

Definition at line 104 of file light.c.

105{
107
108 TRACE("iface %p, data %#x.\n", iface, data);
109
110 light->obj.appdata = data;
111
112 return D3DRM_OK;
113}
#define D3DRM_OK
Definition: d3drm.h:486
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ d3drm_light_SetColor()

static HRESULT WINAPI d3drm_light_SetColor ( IDirect3DRMLight *  iface,
D3DCOLOR  color 
)
static

Definition at line 162 of file light.c.

163{
165
166 TRACE("iface %p, color 0x%08x.\n", iface, color);
167
168 light->color = color;
169
170 return D3DRM_OK;
171}
GLuint color
Definition: glext.h:6243

◆ d3drm_light_SetColorRGB()

static HRESULT WINAPI d3drm_light_SetColorRGB ( IDirect3DRMLight *  iface,
D3DVALUE  red,
D3DVALUE  green,
D3DVALUE  blue 
)
static

Definition at line 173 of file light.c.

175{
177
178 TRACE("iface %p, red %.8e, green %.8e, blue %.8e.\n", iface, red, green, blue);
179
180 d3drm_set_color(&light->color, red, green, blue, 1.0f);
181
182 return D3DRM_OK;
183}
static void d3drm_set_color(D3DCOLOR *color, float r, float g, float b, float a)
GLclampf green
Definition: gl.h:1740
GLclampf GLclampf blue
Definition: gl.h:1740
#define red
Definition: linetest.c:67

◆ d3drm_light_SetConstantAttenuation()

static HRESULT WINAPI d3drm_light_SetConstantAttenuation ( IDirect3DRMLight *  iface,
D3DVALUE  attenuation 
)
static

Definition at line 218 of file light.c.

219{
221
222 TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
223
224 light->cattenuation = attenuation;
225
226 return D3DRM_OK;
227}

◆ d3drm_light_SetEnableFrame()

static HRESULT WINAPI d3drm_light_SetEnableFrame ( IDirect3DRMLight *  iface,
IDirect3DRMFrame *  frame 
)
static

Definition at line 323 of file light.c.

324{
325 FIXME("iface %p, frame %p stub!\n", iface, frame);
326
327 return E_NOTIMPL;
328}

◆ d3drm_light_SetLinearAttenuation()

static HRESULT WINAPI d3drm_light_SetLinearAttenuation ( IDirect3DRMLight *  iface,
D3DVALUE  attenuation 
)
static

Definition at line 229 of file light.c.

230{
232
233 TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
234
235 light->lattenuation = attenuation;
236
237 return D3DRM_OK;
238}

◆ d3drm_light_SetName()

static HRESULT WINAPI d3drm_light_SetName ( IDirect3DRMLight *  iface,
const char name 
)
static

Definition at line 124 of file light.c.

125{
127
128 TRACE("iface %p, name %s.\n", iface, debugstr_a(name));
129
130 return d3drm_object_set_name(&light->obj, name);
131}
HRESULT d3drm_object_set_name(struct d3drm_object *object, const char *name)
Definition: d3drm_main.c:135
#define debugstr_a
Definition: kernel32.h:31

◆ d3drm_light_SetPenumbra()

static HRESULT WINAPI d3drm_light_SetPenumbra ( IDirect3DRMLight *  iface,
D3DVALUE  penumbra 
)
static

Definition at line 207 of file light.c.

208{
210
211 TRACE("iface %p, penumbra %.8e.\n", iface, penumbra);
212
213 light->penumbra = penumbra;
214
215 return D3DRM_OK;
216}
D3DVALUE penumbra

◆ d3drm_light_SetQuadraticAttenuation()

static HRESULT WINAPI d3drm_light_SetQuadraticAttenuation ( IDirect3DRMLight *  iface,
D3DVALUE  attenuation 
)
static

Definition at line 240 of file light.c.

241{
243
244 TRACE("iface %p, attenuation %.8e.\n", iface, attenuation);
245
246 light->qattenuation = attenuation;
247
248 return D3DRM_OK;
249}

◆ d3drm_light_SetRange()

static HRESULT WINAPI d3drm_light_SetRange ( IDirect3DRMLight *  iface,
D3DVALUE  range 
)
static

Definition at line 185 of file light.c.

186{
188
189 TRACE("iface %p, range %.8e.\n", iface, range);
190
191 light->range = range;
192
193 return D3DRM_OK;
194}
GLenum GLint * range
Definition: glext.h:7539

◆ d3drm_light_SetType()

static HRESULT WINAPI d3drm_light_SetType ( IDirect3DRMLight *  iface,
D3DRMLIGHTTYPE  type 
)
static

Definition at line 151 of file light.c.

152{
154
155 TRACE("iface %p, type %#x.\n", iface, type);
156
157 light->type = type;
158
159 return D3DRM_OK;
160}
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545

◆ d3drm_light_SetUmbra()

static HRESULT WINAPI d3drm_light_SetUmbra ( IDirect3DRMLight *  iface,
D3DVALUE  umbra 
)
static

Definition at line 196 of file light.c.

197{
199
200 TRACE("iface %p, umbra %.8e.\n", iface, umbra);
201
202 light->umbra = umbra;
203
204 return D3DRM_OK;
205}
D3DVALUE umbra

◆ impl_from_IDirect3DRMLight()

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( d3drm  )

Variable Documentation

◆ d3drm_light_vtbl

const struct IDirect3DRMLightVtbl d3drm_light_vtbl
static

Definition at line 337 of file light.c.

Referenced by d3drm_light_create().