[PATCH 4/5] wined3d: Get rid of the WINED3DLIGHTTYPE typedef.
Henri Verbeet
hverbeet at codeweavers.com
Sun Dec 11 14:43:31 CST 2011
---
dlls/wined3d/device.c | 18 +++++++++---------
dlls/wined3d/state.c | 6 +++---
include/wine/wined3d.h | 17 ++++++++---------
3 files changed, 20 insertions(+), 21 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 74b7a36..24130cb 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -36,7 +36,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d);
/* Define the default light parameters as specified by MSDN. */
const struct wined3d_light WINED3D_default_light =
{
- WINED3DLIGHT_DIRECTIONAL, /* Type */
+ WINED3D_LIGHT_DIRECTIONAL, /* Type */
{ 1.0f, 1.0f, 1.0f, 0.0f }, /* Diffuse r,g,b,a */
{ 0.0f, 0.0f, 0.0f, 0.0f }, /* Specular r,g,b,a */
{ 0.0f, 0.0f, 0.0f, 0.0f }, /* Ambient r,g,b,a, */
@@ -1898,10 +1898,10 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
switch (light->type)
{
- case WINED3DLIGHT_POINT:
- case WINED3DLIGHT_SPOT:
- case WINED3DLIGHT_PARALLELPOINT:
- case WINED3DLIGHT_GLSPOT:
+ case WINED3D_LIGHT_POINT:
+ case WINED3D_LIGHT_SPOT:
+ case WINED3D_LIGHT_PARALLELPOINT:
+ case WINED3D_LIGHT_GLSPOT:
/* Incorrect attenuation values can cause the gl driver to crash.
* Happens with Need for speed most wanted. */
if (light->attenuation0 < 0.0f || light->attenuation1 < 0.0f || light->attenuation2 < 0.0f)
@@ -1911,7 +1911,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
}
break;
- case WINED3DLIGHT_DIRECTIONAL:
+ case WINED3D_LIGHT_DIRECTIONAL:
/* Ignores attenuation */
break;
@@ -1958,7 +1958,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
switch (light->type)
{
- case WINED3DLIGHT_POINT:
+ case WINED3D_LIGHT_POINT:
/* Position */
object->lightPosn[0] = light->position.x;
object->lightPosn[1] = light->position.y;
@@ -1968,7 +1968,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
/* FIXME: Range */
break;
- case WINED3DLIGHT_DIRECTIONAL:
+ case WINED3D_LIGHT_DIRECTIONAL:
/* Direction */
object->lightPosn[0] = -light->direction.x;
object->lightPosn[1] = -light->direction.y;
@@ -1978,7 +1978,7 @@ HRESULT CDECL wined3d_device_set_light(struct wined3d_device *device,
object->cutoff = 180.0f;
break;
- case WINED3DLIGHT_SPOT:
+ case WINED3D_LIGHT_SPOT:
/* Position */
object->lightPosn[0] = light->position.x;
object->lightPosn[1] = light->position.y;
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index e5fbb61..d7b86dc 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -4688,7 +4688,7 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
switch (lightInfo->OriginalParms.type)
{
- case WINED3DLIGHT_POINT:
+ case WINED3D_LIGHT_POINT:
/* Position */
glLightfv(GL_LIGHT0 + Index, GL_POSITION, &lightInfo->lightPosn[0]);
checkGLcall("glLightfv");
@@ -4706,7 +4706,7 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
/* FIXME: Range */
break;
- case WINED3DLIGHT_SPOT:
+ case WINED3D_LIGHT_SPOT:
/* Position */
glLightfv(GL_LIGHT0 + Index, GL_POSITION, &lightInfo->lightPosn[0]);
checkGLcall("glLightfv");
@@ -4729,7 +4729,7 @@ static void light(struct wined3d_context *context, const struct wined3d_state *s
/* FIXME: Range */
break;
- case WINED3DLIGHT_DIRECTIONAL:
+ case WINED3D_LIGHT_DIRECTIONAL:
/* Direction */
glLightfv(GL_LIGHT0 + Index, GL_POSITION, &lightInfo->lightPosn[0]); /* Note gl uses w position of 0 for direction! */
checkGLcall("glLightfv");
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 4f5998c..6af1485 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -65,15 +65,14 @@
#define WINEDDERR_NOCLIPLIST MAKE_WINED3DHRESULT(205)
#define WINEDDERR_OVERLAYNOTVISIBLE MAKE_WINED3DHRESULT(577)
-typedef enum _WINED3DLIGHTTYPE
+enum wined3d_light_type
{
- WINED3DLIGHT_POINT = 1,
- WINED3DLIGHT_SPOT = 2,
- WINED3DLIGHT_DIRECTIONAL = 3,
- WINED3DLIGHT_PARALLELPOINT = 4, /* D3D7 */
- WINED3DLIGHT_GLSPOT = 5, /* D3D7 */
- WINED3DLIGHT_FORCE_DWORD = 0x7fffffff
-} WINED3DLIGHTTYPE;
+ WINED3D_LIGHT_POINT = 1,
+ WINED3D_LIGHT_SPOT = 2,
+ WINED3D_LIGHT_DIRECTIONAL = 3,
+ WINED3D_LIGHT_PARALLELPOINT = 4, /* D3D7 */
+ WINED3D_LIGHT_GLSPOT = 5, /* D3D7 */
+};
typedef enum _WINED3DPRIMITIVETYPE
{
@@ -1553,7 +1552,7 @@ struct wined3d_matrix
struct wined3d_light
{
- WINED3DLIGHTTYPE type;
+ enum wined3d_light_type type;
struct wined3d_color diffuse;
struct wined3d_color specular;
struct wined3d_color ambient;
--
1.7.3.4
More information about the wine-patches
mailing list