[PATCH 4/5] wined3d: Get rid of the WINED3DLINEPATTERN typedef.

Henri Verbeet hverbeet at codeweavers.com
Wed Nov 23 01:51:44 CST 2011


---
 dlls/wined3d/state.c      |   18 +++++++++++-------
 dlls/wined3d/stateblock.c |    9 +++++----
 include/wine/wined3d.h    |    8 ++++----
 3 files changed, 20 insertions(+), 15 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index b9a0dca..e5fbb61 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -1313,20 +1313,24 @@ static void state_colormat(struct wined3d_context *context, const struct wined3d
 
 static void state_linepattern(struct wined3d_context *context, const struct wined3d_state *state, DWORD state_id)
 {
-    union {
-        DWORD                 d;
-        WINED3DLINEPATTERN    lp;
+    union
+    {
+        DWORD d;
+        struct wined3d_line_pattern lp;
     } tmppattern;
     tmppattern.d = state->render_states[WINED3DRS_LINEPATTERN];
 
-    TRACE("Line pattern: repeat %d bits %x\n", tmppattern.lp.wRepeatFactor, tmppattern.lp.wLinePattern);
+    TRACE("Line pattern: repeat %d bits %x.\n", tmppattern.lp.repeat_factor, tmppattern.lp.line_pattern);
 
-    if (tmppattern.lp.wRepeatFactor) {
-        glLineStipple(tmppattern.lp.wRepeatFactor, tmppattern.lp.wLinePattern);
+    if (tmppattern.lp.repeat_factor)
+    {
+        glLineStipple(tmppattern.lp.repeat_factor, tmppattern.lp.line_pattern);
         checkGLcall("glLineStipple(repeat, linepattern)");
         glEnable(GL_LINE_STIPPLE);
         checkGLcall("glEnable(GL_LINE_STIPPLE);");
-    } else {
+    }
+    else
+    {
         glDisable(GL_LINE_STIPPLE);
         checkGLcall("glDisable(GL_LINE_STIPPLE);");
     }
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 33b8ce2..6084a25 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1074,8 +1074,9 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
     struct wined3d_device *device = stateblock->device;
     const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
     struct wined3d_state *state = &stateblock->state;
-    union {
-        WINED3DLINEPATTERN lp;
+    union
+    {
+        struct wined3d_line_pattern lp;
         DWORD d;
     } lp;
     union {
@@ -1109,8 +1110,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock)
        state->render_states[WINED3DRS_ZENABLE] = WINED3DZB_FALSE;
     state->render_states[WINED3DRS_FILLMODE] = WINED3DFILL_SOLID;
     state->render_states[WINED3DRS_SHADEMODE] = WINED3DSHADE_GOURAUD;
-    lp.lp.wRepeatFactor = 0;
-    lp.lp.wLinePattern = 0;
+    lp.lp.repeat_factor = 0;
+    lp.lp.line_pattern = 0;
     state->render_states[WINED3DRS_LINEPATTERN] = lp.d;
     state->render_states[WINED3DRS_ZWRITEENABLE] = TRUE;
     state->render_states[WINED3DRS_ALPHATESTENABLE] = FALSE;
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index f228e44..3ffb8bd 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1590,11 +1590,11 @@ struct wined3d_gamma_ramp
     WORD blue[256];
 };
 
-typedef struct _WINED3DLINEPATTERN
+struct wined3d_line_pattern
 {
-    WORD wRepeatFactor;
-    WORD wLinePattern;
-} WINED3DLINEPATTERN;
+    WORD repeat_factor;
+    WORD line_pattern;
+};
 
 typedef struct _WINEDD3DRECTPATCH_INFO
 {
-- 
1.7.3.4




More information about the wine-patches mailing list