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

Henri Verbeet hverbeet at codeweavers.com
Fri Jan 6 04:20:07 CST 2012


---
 dlls/ddraw/ddraw.c       |    2 +-
 dlls/dxgi/factory.c      |    2 +-
 dlls/wined3d/surface.c   |    4 ++--
 dlls/wined3d/swapchain.c |    8 ++++----
 include/wine/wined3d.h   |   15 +++++++--------
 5 files changed, 15 insertions(+), 16 deletions(-)

diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 28122f8..4dee7af 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -685,7 +685,7 @@ static HRESULT ddraw_create_swapchain(IDirectDrawImpl *ddraw, HWND window, BOOL
     swapchain_desc.backbuffer_width = mode.width;
     swapchain_desc.backbuffer_height = mode.height;
     swapchain_desc.backbuffer_format = mode.format_id;
-    swapchain_desc.swap_effect = WINED3DSWAPEFFECT_COPY;
+    swapchain_desc.swap_effect = WINED3D_SWAP_EFFECT_COPY;
     swapchain_desc.device_window = window;
     swapchain_desc.windowed = windowed;
 
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c
index 44ddce3..b2048ea 100644
--- a/dlls/dxgi/factory.c
+++ b/dlls/dxgi/factory.c
@@ -212,7 +212,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_factory_CreateSwapChain(IWineDXGIFactory *
         wined3d_desc.multisample_type = WINED3DMULTISAMPLE_NONE;
         wined3d_desc.multisample_quality = 0;
     }
-    wined3d_desc.swap_effect = WINED3DSWAPEFFECT_DISCARD;
+    wined3d_desc.swap_effect = WINED3D_SWAP_EFFECT_DISCARD;
     wined3d_desc.device_window = desc->OutputWindow;
     wined3d_desc.windowed = desc->Windowed;
     wined3d_desc.enable_auto_depth_stencil = FALSE;
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index b658832..fdc72ca 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -1689,13 +1689,13 @@ HRESULT CDECL wined3d_surface_blt(struct wined3d_surface *dst_surface, const REC
                     && dst_surface == dst_swapchain->front_buffer
                     && src_surface == dst_swapchain->back_buffers[0])
             {
-                WINED3DSWAPEFFECT swap_effect = dst_swapchain->desc.swap_effect;
+                enum wined3d_swap_effect swap_effect = dst_swapchain->desc.swap_effect;
 
                 TRACE("Using present for backbuffer -> frontbuffer blit.\n");
 
                 /* Set the swap effect to COPY, we don't want the backbuffer
                  * to become undefined. */
-                dst_swapchain->desc.swap_effect = WINED3DSWAPEFFECT_COPY;
+                dst_swapchain->desc.swap_effect = WINED3D_SWAP_EFFECT_COPY;
                 wined3d_swapchain_present(dst_swapchain, NULL, NULL, dst_swapchain->win_handle, NULL, 0);
                 dst_swapchain->desc.swap_effect = swap_effect;
 
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 865b1ba..feefc98 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -546,8 +546,8 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
          *
          * The DISCARD swap effect is ok as well since any backbuffer content is allowed after
          * the swap. */
-        if (swapchain->desc.swap_effect == WINED3DSWAPEFFECT_FLIP)
-            FIXME("Render-to-fbo with WINED3DSWAPEFFECT_FLIP\n");
+        if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
+            FIXME("Render-to-fbo with WINED3D_SWAP_EFFECT_FLIP\n");
 
         swapchain_blit(swapchain, context, &src_rect, &dst_rect);
     }
@@ -588,7 +588,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
      * bug shows up much more than it does on Windows, and the players see single pixels
      * with wrong colors.
      * (The Max Payne bug has been confirmed on Windows with the debug runtime) */
-    if (FALSE && swapchain->desc.swap_effect == WINED3DSWAPEFFECT_DISCARD)
+    if (FALSE && swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_DISCARD)
     {
         static const struct wined3d_color cyan = {0.0f, 1.0f, 1.0f, 1.0f};
 
@@ -632,7 +632,7 @@ static HRESULT swapchain_gl_present(struct wined3d_swapchain *swapchain, const R
          * If the swapeffect is COPY, the content remains the same. If it is FLIP however,
          * the texture / sysmem copy needs to be reloaded from the drawable
          */
-        if (swapchain->desc.swap_effect == WINED3DSWAPEFFECT_FLIP)
+        if (swapchain->desc.swap_effect == WINED3D_SWAP_EFFECT_FLIP)
             surface_modify_location(swapchain->back_buffers[0], swapchain->back_buffers[0]->draw_binding, TRUE);
     }
 
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 08c1c17..4faba78 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -501,14 +501,13 @@ enum wined3d_backbuffer_type
     WINED3D_BACKBUFFER_TYPE_RIGHT           = 2,
 };
 
-typedef enum _WINED3DSWAPEFFECT
+enum wined3d_swap_effect
 {
-    WINED3DSWAPEFFECT_DISCARD               = 1,
-    WINED3DSWAPEFFECT_FLIP                  = 2,
-    WINED3DSWAPEFFECT_COPY                  = 3,
-    WINED3DSWAPEFFECT_COPY_VSYNC            = 4,
-    WINED3DSWAPEFFECT_FORCE_DWORD           = 0xffffffff
-} WINED3DSWAPEFFECT;
+    WINED3D_SWAP_EFFECT_DISCARD             = 1,
+    WINED3D_SWAP_EFFECT_FLIP                = 2,
+    WINED3D_SWAP_EFFECT_COPY                = 3,
+    WINED3D_SWAP_EFFECT_COPY_VSYNC          = 4,
+};
 
 typedef enum _WINED3DSAMPLERSTATETYPE
 {
@@ -1629,7 +1628,7 @@ struct wined3d_swapchain_desc
     UINT backbuffer_count;
     WINED3DMULTISAMPLE_TYPE multisample_type;
     DWORD multisample_quality;
-    WINED3DSWAPEFFECT swap_effect;
+    enum wined3d_swap_effect swap_effect;
     HWND device_window;
     BOOL windowed;
     BOOL enable_auto_depth_stencil;
-- 
1.7.3.4




More information about the wine-patches mailing list