ReactOS  0.4.14-dev-323-g6fe6a88
material.c File Reference
#include "config.h"
#include "wine/port.h"
#include "ddraw_private.h"
Include dependency graph for material.c:

Go to the source code of this file.

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (ddraw)
 
static void dump_material (const D3DMATERIAL *mat)
 
static struct d3d_materialimpl_from_IDirect3DMaterial (IDirect3DMaterial *iface)
 
static struct d3d_materialimpl_from_IDirect3DMaterial2 (IDirect3DMaterial2 *iface)
 
static struct d3d_materialimpl_from_IDirect3DMaterial3 (IDirect3DMaterial3 *iface)
 
static HRESULT WINAPI d3d_material3_QueryInterface (IDirect3DMaterial3 *iface, REFIID riid, void **obp)
 
static ULONG WINAPI d3d_material3_AddRef (IDirect3DMaterial3 *iface)
 
static ULONG WINAPI d3d_material3_Release (IDirect3DMaterial3 *iface)
 
static HRESULT WINAPI d3d_material1_Initialize (IDirect3DMaterial *iface, IDirect3D *d3d)
 
static HRESULT WINAPI d3d_material1_Reserve (IDirect3DMaterial *iface)
 
static HRESULT WINAPI d3d_material1_Unreserve (IDirect3DMaterial *iface)
 
static HRESULT WINAPI d3d_material3_SetMaterial (IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
 
static HRESULT WINAPI d3d_material3_GetMaterial (IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
 
static HRESULT WINAPI d3d_material3_GetHandle (IDirect3DMaterial3 *iface, IDirect3DDevice3 *device, D3DMATERIALHANDLE *handle)
 
static HRESULT WINAPI d3d_material2_GetHandle (IDirect3DMaterial2 *iface, IDirect3DDevice2 *device, D3DMATERIALHANDLE *handle)
 
static HRESULT WINAPI d3d_material1_GetHandle (IDirect3DMaterial *iface, IDirect3DDevice *device, D3DMATERIALHANDLE *handle)
 
static HRESULT WINAPI d3d_material2_QueryInterface (IDirect3DMaterial2 *iface, REFIID riid, void **object)
 
static HRESULT WINAPI d3d_material1_QueryInterface (IDirect3DMaterial *iface, REFIID riid, void **object)
 
static ULONG WINAPI d3d_material2_AddRef (IDirect3DMaterial2 *iface)
 
static ULONG WINAPI d3d_material1_AddRef (IDirect3DMaterial *iface)
 
static ULONG WINAPI d3d_material2_Release (IDirect3DMaterial2 *iface)
 
static ULONG WINAPI d3d_material1_Release (IDirect3DMaterial *iface)
 
static HRESULT WINAPI d3d_material2_SetMaterial (IDirect3DMaterial2 *iface, D3DMATERIAL *mat)
 
static HRESULT WINAPI d3d_material1_SetMaterial (IDirect3DMaterial *iface, D3DMATERIAL *mat)
 
static HRESULT WINAPI d3d_material2_GetMaterial (IDirect3DMaterial2 *iface, D3DMATERIAL *mat)
 
static HRESULT WINAPI d3d_material1_GetMaterial (IDirect3DMaterial *iface, D3DMATERIAL *mat)
 
void material_activate (struct d3d_material *material)
 
struct d3d_materiald3d_material_create (struct ddraw *ddraw)
 

Variables

static const struct IDirect3DMaterial3Vtbl d3d_material3_vtbl
 
static const struct IDirect3DMaterial2Vtbl d3d_material2_vtbl
 
static const struct IDirect3DMaterialVtbl d3d_material1_vtbl
 

Function Documentation

◆ d3d_material1_AddRef()

static ULONG WINAPI d3d_material1_AddRef ( IDirect3DMaterial *  iface)
static

Definition at line 374 of file material.c.

375 {
376  struct d3d_material *material = impl_from_IDirect3DMaterial(iface);
377 
378  TRACE("iface %p.\n", iface);
379 
381 }
static ULONG WINAPI d3d_material3_AddRef(IDirect3DMaterial3 *iface)
Definition: material.c:117
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
Definition: material.c:32
IDirect3DMaterial3 IDirect3DMaterial3_iface

◆ d3d_material1_GetHandle()

static HRESULT WINAPI d3d_material1_GetHandle ( IDirect3DMaterial *  iface,
IDirect3DDevice *  device,
D3DMATERIALHANDLE handle 
)
static

Definition at line 335 of file material.c.

337 {
338  struct d3d_material *material = impl_from_IDirect3DMaterial(iface);
339  struct d3d_device *device_impl = unsafe_impl_from_IDirect3DDevice(device);
340 
341  TRACE("iface %p, device %p, handle %p.\n", iface, device, handle);
342 
343  return d3d_material3_GetHandle(&material->IDirect3DMaterial3_iface,
344  device_impl ? &device_impl->IDirect3DDevice3_iface : NULL, handle);
345 }
struct d3d_device * unsafe_impl_from_IDirect3DDevice(IDirect3DDevice *iface) DECLSPEC_HIDDEN
Definition: device.c:6871
Definition: devices.h:37
DWORD material
smooth NULL
Definition: ftsmooth.c:416
IDirect3DDevice3 IDirect3DDevice3_iface
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
Definition: material.c:32
static HRESULT WINAPI d3d_material3_GetHandle(IDirect3DMaterial3 *iface, IDirect3DDevice3 *device, D3DMATERIALHANDLE *handle)
Definition: material.c:294

◆ d3d_material1_GetMaterial()

static HRESULT WINAPI d3d_material1_GetMaterial ( IDirect3DMaterial *  iface,
D3DMATERIAL mat 
)
static

Definition at line 428 of file material.c.

429 {
430  struct d3d_material *material = impl_from_IDirect3DMaterial(iface);
431 
432  TRACE("iface %p, material %p.\n", iface, mat);
433 
435 }
static HRESULT WINAPI d3d_material3_GetMaterial(IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
Definition: material.c:258
static const MAT2 mat
Definition: font.c:66
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
Definition: material.c:32
IDirect3DMaterial3 IDirect3DMaterial3_iface

◆ d3d_material1_Initialize()

static HRESULT WINAPI d3d_material1_Initialize ( IDirect3DMaterial *  iface,
IDirect3D *  d3d 
)
static

Definition at line 175 of file material.c.

176 {
177  TRACE("iface %p, d3d %p.\n", iface, d3d);
178 
179  return D3D_OK;
180 }
#define TRACE(s)
Definition: solgame.cpp:4
#define D3D_OK
Definition: d3d.h:106

◆ d3d_material1_QueryInterface()

static HRESULT WINAPI d3d_material1_QueryInterface ( IDirect3DMaterial *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 356 of file material.c.

357 {
358  struct d3d_material *material = impl_from_IDirect3DMaterial(iface);
359 
360  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
361 
362  return d3d_material3_QueryInterface(&material->IDirect3DMaterial3_iface, riid, object);
363 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
Definition: material.c:32
IDirect3DMaterial3 IDirect3DMaterial3_iface
static HRESULT WINAPI d3d_material3_QueryInterface(IDirect3DMaterial3 *iface, REFIID riid, void **obp)
Definition: material.c:66

◆ d3d_material1_Release()

static ULONG WINAPI d3d_material1_Release ( IDirect3DMaterial *  iface)
static

Definition at line 392 of file material.c.

393 {
394  struct d3d_material *material = impl_from_IDirect3DMaterial(iface);
395 
396  TRACE("iface %p.\n", iface);
397 
399 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
Definition: material.c:32
IDirect3DMaterial3 IDirect3DMaterial3_iface
static ULONG WINAPI d3d_material3_Release(IDirect3DMaterial3 *iface)
Definition: material.c:137

◆ d3d_material1_Reserve()

static HRESULT WINAPI d3d_material1_Reserve ( IDirect3DMaterial *  iface)
static

Definition at line 192 of file material.c.

193 {
194  TRACE("iface %p.\n", iface);
195 
196  return DDERR_UNSUPPORTED;
197 }
#define DDERR_UNSUPPORTED
Definition: ddraw.h:127
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_material1_SetMaterial()

static HRESULT WINAPI d3d_material1_SetMaterial ( IDirect3DMaterial *  iface,
D3DMATERIAL mat 
)
static

Definition at line 410 of file material.c.

411 {
412  struct d3d_material *material = impl_from_IDirect3DMaterial(iface);
413 
414  TRACE("iface %p, material %p.\n", iface, mat);
415 
417 }
static const MAT2 mat
Definition: font.c:66
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial(IDirect3DMaterial *iface)
Definition: material.c:32
IDirect3DMaterial3 IDirect3DMaterial3_iface
static HRESULT WINAPI d3d_material3_SetMaterial(IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
Definition: material.c:228

◆ d3d_material1_Unreserve()

static HRESULT WINAPI d3d_material1_Unreserve ( IDirect3DMaterial *  iface)
static

Definition at line 208 of file material.c.

209 {
210  TRACE("iface %p.\n", iface);
211 
212  return DDERR_UNSUPPORTED;
213 }
#define DDERR_UNSUPPORTED
Definition: ddraw.h:127
#define TRACE(s)
Definition: solgame.cpp:4

◆ d3d_material2_AddRef()

static ULONG WINAPI d3d_material2_AddRef ( IDirect3DMaterial2 *  iface)
static

Definition at line 365 of file material.c.

366 {
367  struct d3d_material *material = impl_from_IDirect3DMaterial2(iface);
368 
369  TRACE("iface %p.\n", iface);
370 
372 }
static ULONG WINAPI d3d_material3_AddRef(IDirect3DMaterial3 *iface)
Definition: material.c:117
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial2(IDirect3DMaterial2 *iface)
Definition: material.c:37
IDirect3DMaterial3 IDirect3DMaterial3_iface

◆ d3d_material2_GetHandle()

static HRESULT WINAPI d3d_material2_GetHandle ( IDirect3DMaterial2 *  iface,
IDirect3DDevice2 *  device,
D3DMATERIALHANDLE handle 
)
static

Definition at line 323 of file material.c.

325 {
326  struct d3d_material *material = impl_from_IDirect3DMaterial2(iface);
327  struct d3d_device *device_impl = unsafe_impl_from_IDirect3DDevice2(device);
328 
329  TRACE("iface %p, device %p, handle %p.\n", iface, device, handle);
330 
331  return d3d_material3_GetHandle(&material->IDirect3DMaterial3_iface,
332  device_impl ? &device_impl->IDirect3DDevice3_iface : NULL, handle);
333 }
Definition: devices.h:37
struct d3d_device * unsafe_impl_from_IDirect3DDevice2(IDirect3DDevice2 *iface) DECLSPEC_HIDDEN
Definition: device.c:6864
DWORD material
smooth NULL
Definition: ftsmooth.c:416
IDirect3DDevice3 IDirect3DDevice3_iface
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI d3d_material3_GetHandle(IDirect3DMaterial3 *iface, IDirect3DDevice3 *device, D3DMATERIALHANDLE *handle)
Definition: material.c:294
static struct d3d_material * impl_from_IDirect3DMaterial2(IDirect3DMaterial2 *iface)
Definition: material.c:37

◆ d3d_material2_GetMaterial()

static HRESULT WINAPI d3d_material2_GetMaterial ( IDirect3DMaterial2 *  iface,
D3DMATERIAL mat 
)
static

Definition at line 419 of file material.c.

420 {
421  struct d3d_material *material = impl_from_IDirect3DMaterial2(iface);
422 
423  TRACE("iface %p, material %p.\n", iface, mat);
424 
426 }
static HRESULT WINAPI d3d_material3_GetMaterial(IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
Definition: material.c:258
static const MAT2 mat
Definition: font.c:66
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial2(IDirect3DMaterial2 *iface)
Definition: material.c:37
IDirect3DMaterial3 IDirect3DMaterial3_iface

◆ d3d_material2_QueryInterface()

static HRESULT WINAPI d3d_material2_QueryInterface ( IDirect3DMaterial2 *  iface,
REFIID  riid,
void **  object 
)
static

Definition at line 347 of file material.c.

348 {
349  struct d3d_material *material = impl_from_IDirect3DMaterial2(iface);
350 
351  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), object);
352 
353  return d3d_material3_QueryInterface(&material->IDirect3DMaterial3_iface, riid, object);
354 }
REFIID riid
Definition: precomp.h:44
#define debugstr_guid
Definition: kernel32.h:35
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial2(IDirect3DMaterial2 *iface)
Definition: material.c:37
IDirect3DMaterial3 IDirect3DMaterial3_iface
static HRESULT WINAPI d3d_material3_QueryInterface(IDirect3DMaterial3 *iface, REFIID riid, void **obp)
Definition: material.c:66

◆ d3d_material2_Release()

static ULONG WINAPI d3d_material2_Release ( IDirect3DMaterial2 *  iface)
static

Definition at line 383 of file material.c.

384 {
385  struct d3d_material *material = impl_from_IDirect3DMaterial2(iface);
386 
387  TRACE("iface %p.\n", iface);
388 
390 }
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial2(IDirect3DMaterial2 *iface)
Definition: material.c:37
IDirect3DMaterial3 IDirect3DMaterial3_iface
static ULONG WINAPI d3d_material3_Release(IDirect3DMaterial3 *iface)
Definition: material.c:137

◆ d3d_material2_SetMaterial()

static HRESULT WINAPI d3d_material2_SetMaterial ( IDirect3DMaterial2 *  iface,
D3DMATERIAL mat 
)
static

Definition at line 401 of file material.c.

402 {
403  struct d3d_material *material = impl_from_IDirect3DMaterial2(iface);
404 
405  TRACE("iface %p, material %p.\n", iface, mat);
406 
408 }
static const MAT2 mat
Definition: font.c:66
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial2(IDirect3DMaterial2 *iface)
Definition: material.c:37
IDirect3DMaterial3 IDirect3DMaterial3_iface
static HRESULT WINAPI d3d_material3_SetMaterial(IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
Definition: material.c:228

◆ d3d_material3_AddRef()

static ULONG WINAPI d3d_material3_AddRef ( IDirect3DMaterial3 *  iface)
static

Definition at line 117 of file material.c.

118 {
119  struct d3d_material *material = impl_from_IDirect3DMaterial3(iface);
120  ULONG ref = InterlockedIncrement(&material->ref);
121 
122  TRACE("%p increasing refcount to %u.\n", material, ref);
123 
124  return ref;
125 }
Definition: send.c:47
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
static struct d3d_material * impl_from_IDirect3DMaterial3(IDirect3DMaterial3 *iface)
Definition: material.c:42
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

Referenced by d3d_material1_AddRef(), and d3d_material2_AddRef().

◆ d3d_material3_GetHandle()

static HRESULT WINAPI d3d_material3_GetHandle ( IDirect3DMaterial3 *  iface,
IDirect3DDevice3 *  device,
D3DMATERIALHANDLE handle 
)
static

Definition at line 294 of file material.c.

296 {
297  struct d3d_material *material = impl_from_IDirect3DMaterial3(iface);
298  struct d3d_device *device_impl = unsafe_impl_from_IDirect3DDevice3(device);
299 
300  TRACE("iface %p, device %p, handle %p.\n", iface, device, handle);
301 
303  material->active_device = device_impl;
304  if (!material->Handle)
305  {
307  if (h == DDRAW_INVALID_HANDLE)
308  {
309  ERR("Failed to allocate a material handle.\n");
311  return DDERR_INVALIDPARAMS; /* Unchecked */
312  }
313 
314  material->Handle = h + 1;
315  }
316  *handle = material->Handle;
317  TRACE(" returning handle %08x.\n", *handle);
319 
320  return D3D_OK;
321 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
Definition: devices.h:37
DWORD material
#define TRACE(s)
Definition: solgame.cpp:4
DWORD ddraw_allocate_handle(struct ddraw_handle_table *t, void *object, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:113
#define DDRAW_INVALID_HANDLE
unsigned long DWORD
Definition: ntddk_ex.h:95
struct d3d_device * unsafe_impl_from_IDirect3DDevice3(IDirect3DDevice3 *iface) DECLSPEC_HIDDEN
Definition: device.c:6857
struct ddraw_handle_table handle_table
#define ERR(fmt,...)
Definition: debug.h:109
static struct d3d_material * impl_from_IDirect3DMaterial3(IDirect3DMaterial3 *iface)
Definition: material.c:42
#define D3D_OK
Definition: d3d.h:106
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define DDERR_INVALIDPARAMS
Definition: ddraw.h:79

Referenced by d3d_material1_GetHandle(), and d3d_material2_GetHandle().

◆ d3d_material3_GetMaterial()

static HRESULT WINAPI d3d_material3_GetMaterial ( IDirect3DMaterial3 *  iface,
D3DMATERIAL mat 
)
static

Definition at line 258 of file material.c.

259 {
260  struct d3d_material *material = impl_from_IDirect3DMaterial3(iface);
261  DWORD dwSize;
262 
263  TRACE("iface %p, mat %p.\n", iface, mat);
264  if (TRACE_ON(ddraw))
265  {
266  TRACE(" Returning material : ");
267  dump_material(&material->mat);
268  }
269 
270  /* Copies the material structure */
272  dwSize = mat->dwSize;
273  memcpy(mat, &material->mat, dwSize);
275 
276  return DD_OK;
277 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static void dump_material(const D3DMATERIAL *mat)
Definition: material.c:27
static const MAT2 mat
Definition: font.c:66
#define DD_OK
Definition: ddraw.h:186
#define TRACE(s)
Definition: solgame.cpp:4
unsigned long DWORD
Definition: ntddk_ex.h:95
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct d3d_material * impl_from_IDirect3DMaterial3(IDirect3DMaterial3 *iface)
Definition: material.c:42
D3DMATERIAL mat
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define TRACE_ON(x)
Definition: compat.h:65
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54

Referenced by d3d_material1_GetMaterial(), and d3d_material2_GetMaterial().

◆ d3d_material3_QueryInterface()

static HRESULT WINAPI d3d_material3_QueryInterface ( IDirect3DMaterial3 *  iface,
REFIID  riid,
void **  obp 
)
static

Definition at line 66 of file material.c.

67 {
68  struct d3d_material *material = impl_from_IDirect3DMaterial3(iface);
69 
70  TRACE("iface %p, riid %s, object %p.\n", iface, debugstr_guid(riid), obp);
71 
72  *obp = NULL;
73 
75  {
77  *obp = iface;
78  TRACE(" Creating IUnknown interface at %p.\n", *obp);
79  return S_OK;
80  }
81  if (IsEqualGUID(&IID_IDirect3DMaterial, riid))
82  {
84  *obp = &material->IDirect3DMaterial_iface;
85  TRACE(" Creating IDirect3DMaterial interface %p\n", *obp);
86  return S_OK;
87  }
88  if (IsEqualGUID(&IID_IDirect3DMaterial2, riid))
89  {
91  *obp = &material->IDirect3DMaterial2_iface;
92  TRACE(" Creating IDirect3DMaterial2 interface %p\n", *obp);
93  return S_OK;
94  }
95  if (IsEqualGUID(&IID_IDirect3DMaterial3, riid))
96  {
98  *obp = &material->IDirect3DMaterial3_iface;
99  TRACE(" Creating IDirect3DMaterial3 interface %p\n", *obp);
100  return S_OK;
101  }
102 
103  WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid));
104 
105  return E_NOINTERFACE;
106 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define WARN(fmt,...)
Definition: debug.h:111
IDirect3DMaterial2 IDirect3DMaterial2_iface
#define IDirect3DMaterial_AddRef(p)
Definition: d3d.h:463
smooth NULL
Definition: ftsmooth.c:416
#define debugstr_guid
Definition: kernel32.h:35
#define IDirect3DMaterial2_AddRef(p)
Definition: d3d.h:507
#define TRACE(s)
Definition: solgame.cpp:4
#define IDirect3DMaterial3_AddRef(p)
Definition: d3d.h:545
const GUID IID_IUnknown
static struct d3d_material * impl_from_IDirect3DMaterial3(IDirect3DMaterial3 *iface)
Definition: material.c:42
#define S_OK
Definition: intsafe.h:59
IDirect3DMaterial IDirect3DMaterial_iface
IDirect3DMaterial3 IDirect3DMaterial3_iface
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4112

Referenced by d3d_material1_QueryInterface(), and d3d_material2_QueryInterface().

◆ d3d_material3_Release()

static ULONG WINAPI d3d_material3_Release ( IDirect3DMaterial3 *  iface)
static

Definition at line 137 of file material.c.

138 {
139  struct d3d_material *material = impl_from_IDirect3DMaterial3(iface);
140  ULONG ref = InterlockedDecrement(&material->ref);
141 
142  TRACE("%p decreasing refcount to %u.\n", material, ref);
143 
144  if (!ref)
145  {
146  if (material->Handle)
147  {
149  ddraw_free_handle(&material->ddraw->d3ddevice->handle_table, material->Handle - 1, DDRAW_HANDLE_MATERIAL);
151  }
152 
153  heap_free(material);
154  }
155 
156  return ref;
157 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
Definition: send.c:47
struct ddraw * ddraw
GLenum GLint ref
Definition: glext.h:6028
#define TRACE(s)
Definition: solgame.cpp:4
#define InterlockedDecrement
Definition: armddk.h:52
static struct d3d_material * impl_from_IDirect3DMaterial3(IDirect3DMaterial3 *iface)
Definition: material.c:42
void * ddraw_free_handle(struct ddraw_handle_table *t, DWORD handle, enum ddraw_handle_type type) DECLSPEC_HIDDEN
Definition: main.c:156
unsigned int ULONG
Definition: retypes.h:1
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by d3d_material1_Release(), and d3d_material2_Release().

◆ d3d_material3_SetMaterial()

static HRESULT WINAPI d3d_material3_SetMaterial ( IDirect3DMaterial3 *  iface,
D3DMATERIAL mat 
)
static

Definition at line 228 of file material.c.

229 {
230  struct d3d_material *material = impl_from_IDirect3DMaterial3(iface);
231 
232  TRACE("iface %p, mat %p.\n", iface, mat);
233  if (TRACE_ON(ddraw))
235 
236  /* Stores the material */
238  memset(&material->mat, 0, sizeof(material->mat));
239  memcpy(&material->mat, mat, mat->dwSize);
241 
242  return DD_OK;
243 }
void WINAPI wined3d_mutex_lock(void)
Definition: wined3d_main.c:368
static void dump_material(const D3DMATERIAL *mat)
Definition: material.c:27
static const MAT2 mat
Definition: font.c:66
#define DD_OK
Definition: ddraw.h:186
#define TRACE(s)
Definition: solgame.cpp:4
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static struct d3d_material * impl_from_IDirect3DMaterial3(IDirect3DMaterial3 *iface)
Definition: material.c:42
D3DMATERIAL mat
void WINAPI wined3d_mutex_unlock(void)
Definition: wined3d_main.c:373
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE_ON(x)
Definition: compat.h:65

Referenced by d3d_material1_SetMaterial(), and d3d_material2_SetMaterial().

◆ d3d_material_create()

struct d3d_material* d3d_material_create ( struct ddraw ddraw)

Definition at line 501 of file material.c.

502 {
503  struct d3d_material *material;
504 
505  if (!(material = heap_alloc_zero(sizeof(*material))))
506  return NULL;
507 
508  material->IDirect3DMaterial3_iface.lpVtbl = &d3d_material3_vtbl;
509  material->IDirect3DMaterial2_iface.lpVtbl = &d3d_material2_vtbl;
510  material->IDirect3DMaterial_iface.lpVtbl = &d3d_material1_vtbl;
511  material->ref = 1;
512  material->ddraw = ddraw;
513 
514  return material;
515 }
IDirect3DMaterial2 IDirect3DMaterial2_iface
struct ddraw * ddraw
smooth NULL
Definition: ftsmooth.c:416
static const struct IDirect3DMaterial3Vtbl d3d_material3_vtbl
Definition: material.c:462
static const struct IDirect3DMaterial2Vtbl d3d_material2_vtbl
Definition: material.c:474
IDirect3DMaterial IDirect3DMaterial_iface
IDirect3DMaterial3 IDirect3DMaterial3_iface
static const struct IDirect3DMaterialVtbl d3d_material1_vtbl
Definition: material.c:486

Referenced by d3d1_CreateMaterial(), d3d2_CreateMaterial(), and d3d3_CreateMaterial().

◆ dump_material()

static void dump_material ( const D3DMATERIAL mat)
static

Definition at line 27 of file material.c.

28 {
29  TRACE(" dwSize : %d\n", mat->dwSize);
30 }
static const MAT2 mat
Definition: font.c:66
#define TRACE(s)
Definition: solgame.cpp:4

Referenced by d3d_material3_GetMaterial(), and d3d_material3_SetMaterial().

◆ impl_from_IDirect3DMaterial()

static struct d3d_material* impl_from_IDirect3DMaterial ( IDirect3DMaterial *  iface)
inlinestatic

Definition at line 32 of file material.c.

33 {
35 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
IDirect3DMaterial IDirect3DMaterial_iface

Referenced by d3d_material1_AddRef(), d3d_material1_GetHandle(), d3d_material1_GetMaterial(), d3d_material1_QueryInterface(), d3d_material1_Release(), and d3d_material1_SetMaterial().

◆ impl_from_IDirect3DMaterial2()

static struct d3d_material* impl_from_IDirect3DMaterial2 ( IDirect3DMaterial2 *  iface)
inlinestatic

Definition at line 37 of file material.c.

38 {
40 }
IDirect3DMaterial2 IDirect3DMaterial2_iface
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by d3d_material2_AddRef(), d3d_material2_GetHandle(), d3d_material2_GetMaterial(), d3d_material2_QueryInterface(), d3d_material2_Release(), and d3d_material2_SetMaterial().

◆ impl_from_IDirect3DMaterial3()

static struct d3d_material* impl_from_IDirect3DMaterial3 ( IDirect3DMaterial3 *  iface)
inlinestatic

Definition at line 42 of file material.c.

43 {
45 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
IDirect3DMaterial3 IDirect3DMaterial3_iface

Referenced by d3d_material3_AddRef(), d3d_material3_GetHandle(), d3d_material3_GetMaterial(), d3d_material3_QueryInterface(), d3d_material3_Release(), and d3d_material3_SetMaterial().

◆ material_activate()

void material_activate ( struct d3d_material material)

Definition at line 447 of file material.c.

448 {
449  D3DMATERIAL7 d3d7mat;
450 
451  TRACE("Activating material %p.\n", material);
452 
453  d3d7mat.u.diffuse = material->mat.u.diffuse;
454  d3d7mat.u1.ambient = material->mat.u1.ambient;
455  d3d7mat.u2.specular = material->mat.u2.specular;
456  d3d7mat.u3.emissive = material->mat.u3.emissive;
457  d3d7mat.u4.power = material->mat.u4.power;
458 
459  IDirect3DDevice7_SetMaterial(&material->active_device->IDirect3DDevice7_iface, &d3d7mat);
460 }
#define IDirect3DDevice7_SetMaterial(p, a)
Definition: d3d.h:1359
D3DCOLORVALUE diffuse
Definition: d3dtypes.h:506
D3DVALUE power
Definition: d3dtypes.h:547
D3DVALUE power
Definition: d3dtypes.h:522
D3DCOLORVALUE emissive
Definition: d3dtypes.h:543
struct d3d_device * active_device
#define TRACE(s)
Definition: solgame.cpp:4
D3DCOLORVALUE specular
Definition: d3dtypes.h:514
D3DCOLORVALUE diffuse
Definition: d3dtypes.h:531
D3DCOLORVALUE emissive
Definition: d3dtypes.h:518
D3DCOLORVALUE ambient
Definition: d3dtypes.h:535
D3DCOLORVALUE ambient
Definition: d3dtypes.h:510
D3DMATERIAL mat
D3DCOLORVALUE specular
Definition: d3dtypes.h:539

Referenced by d3d_device3_SetLightState().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( ddraw  )

Variable Documentation

◆ d3d_material1_vtbl

const struct IDirect3DMaterialVtbl d3d_material1_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d_material1_QueryInterface(IDirect3DMaterial *iface, REFIID riid, void **object)
Definition: material.c:356
static HRESULT WINAPI d3d_material1_GetMaterial(IDirect3DMaterial *iface, D3DMATERIAL *mat)
Definition: material.c:428
static HRESULT WINAPI d3d_material1_Initialize(IDirect3DMaterial *iface, IDirect3D *d3d)
Definition: material.c:175
static HRESULT WINAPI d3d_material1_Unreserve(IDirect3DMaterial *iface)
Definition: material.c:208
static ULONG WINAPI d3d_material1_AddRef(IDirect3DMaterial *iface)
Definition: material.c:374
static HRESULT WINAPI d3d_material1_Reserve(IDirect3DMaterial *iface)
Definition: material.c:192
static ULONG WINAPI d3d_material1_Release(IDirect3DMaterial *iface)
Definition: material.c:392
static HRESULT WINAPI d3d_material1_SetMaterial(IDirect3DMaterial *iface, D3DMATERIAL *mat)
Definition: material.c:410
static HRESULT WINAPI d3d_material1_GetHandle(IDirect3DMaterial *iface, IDirect3DDevice *device, D3DMATERIALHANDLE *handle)
Definition: material.c:335

Definition at line 486 of file material.c.

Referenced by d3d_material_create().

◆ d3d_material2_vtbl

const struct IDirect3DMaterial2Vtbl d3d_material2_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d_material2_GetHandle(IDirect3DMaterial2 *iface, IDirect3DDevice2 *device, D3DMATERIALHANDLE *handle)
Definition: material.c:323
static ULONG WINAPI d3d_material2_AddRef(IDirect3DMaterial2 *iface)
Definition: material.c:365
static HRESULT WINAPI d3d_material2_SetMaterial(IDirect3DMaterial2 *iface, D3DMATERIAL *mat)
Definition: material.c:401
static HRESULT WINAPI d3d_material2_GetMaterial(IDirect3DMaterial2 *iface, D3DMATERIAL *mat)
Definition: material.c:419
static ULONG WINAPI d3d_material2_Release(IDirect3DMaterial2 *iface)
Definition: material.c:383
static HRESULT WINAPI d3d_material2_QueryInterface(IDirect3DMaterial2 *iface, REFIID riid, void **object)
Definition: material.c:347

Definition at line 474 of file material.c.

Referenced by d3d_material_create().

◆ d3d_material3_vtbl

const struct IDirect3DMaterial3Vtbl d3d_material3_vtbl
static
Initial value:
=
{
}
static HRESULT WINAPI d3d_material3_GetMaterial(IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
Definition: material.c:258
static ULONG WINAPI d3d_material3_AddRef(IDirect3DMaterial3 *iface)
Definition: material.c:117
static HRESULT WINAPI d3d_material3_GetHandle(IDirect3DMaterial3 *iface, IDirect3DDevice3 *device, D3DMATERIALHANDLE *handle)
Definition: material.c:294
static HRESULT WINAPI d3d_material3_SetMaterial(IDirect3DMaterial3 *iface, D3DMATERIAL *mat)
Definition: material.c:228
static ULONG WINAPI d3d_material3_Release(IDirect3DMaterial3 *iface)
Definition: material.c:137
static HRESULT WINAPI d3d_material3_QueryInterface(IDirect3DMaterial3 *iface, REFIID riid, void **obp)
Definition: material.c:66

Definition at line 462 of file material.c.

Referenced by d3d_material_create().