[PATCH 3/5] wined3d: Remove the version parameter.

Stefan Dösinger stefan at codeweavers.com
Sat Mar 8 15:53:13 CST 2014


---
 dlls/d3d8/directx.c            | 2 +-
 dlls/d3d9/directx.c            | 2 +-
 dlls/ddraw/ddraw.c             | 6 +++---
 dlls/ddraw/main.c              | 4 ++--
 dlls/dxgi/factory.c            | 2 +-
 dlls/wined3d/directx.c         | 3 +--
 dlls/wined3d/wined3d.spec      | 2 +-
 dlls/wined3d/wined3d_main.c    | 8 ++++----
 dlls/wined3d/wined3d_private.h | 3 +--
 include/wine/wined3d.h         | 3 ++-
 10 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index 4aac722..7270881 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -410,7 +410,7 @@ BOOL d3d8_init(struct d3d8 *d3d8)
     d3d8->refcount = 1;
 
     wined3d_mutex_lock();
-    d3d8->wined3d = wined3d_create(8, flags);
+    d3d8->wined3d = wined3d_create(flags);
     wined3d_mutex_unlock();
     if (!d3d8->wined3d)
         return FALSE;
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index 79e9eb5..6280d12 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -644,7 +644,7 @@ BOOL d3d9_init(struct d3d9 *d3d9, BOOL extended)
     d3d9->refcount = 1;
 
     wined3d_mutex_lock();
-    d3d9->wined3d = wined3d_create(9, flags);
+    d3d9->wined3d = wined3d_create(flags);
     wined3d_mutex_unlock();
     if (!d3d9->wined3d)
         return FALSE;
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index ed0606f..52e778a 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -4870,10 +4870,10 @@ HRESULT ddraw_init(struct ddraw *ddraw, enum wined3d_device_type device_type)
     ddraw->numIfaces = 1;
     ddraw->ref7 = 1;
 
-    flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING;
-    if (!(ddraw->wined3d = wined3d_create(7, flags)))
+    flags = WINED3D_LEGACY_DEPTH_BIAS | WINED3D_VIDMEM_ACCOUNTING | WINED3D_ALLOW_3D_DISABLE;
+    if (!(ddraw->wined3d = wined3d_create(flags)))
     {
-        if (!(ddraw->wined3d = wined3d_create(7, flags | WINED3D_NO3D)))
+        if (!(ddraw->wined3d = wined3d_create(flags | WINED3D_NO3D)))
         {
             WARN("Failed to create a wined3d object.\n");
             return E_FAIL;
diff --git a/dlls/ddraw/main.c b/dlls/ddraw/main.c
index 3bcd9b8..a0a3cb9 100644
--- a/dlls/ddraw/main.c
+++ b/dlls/ddraw/main.c
@@ -408,9 +408,9 @@ HRESULT WINAPI DirectDrawEnumerateExA(LPDDENUMCALLBACKEXA callback, void *contex
         FIXME("flags 0x%08x not handled\n", flags & ~DDENUM_ATTACHEDSECONDARYDEVICES);
 
     TRACE("Enumerating ddraw interfaces\n");
-    if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS)))
+    if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS | WINED3D_ALLOW_3D_DISABLE)))
     {
-        if (!(wined3d = wined3d_create(7, WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D)))
+        if (!(wined3d = wined3d_create(WINED3D_LEGACY_DEPTH_BIAS | WINED3D_NO3D)))
         {
             WARN("Failed to create a wined3d object.\n");
             return E_FAIL;
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c
index ac2450e..98d036e 100644
--- a/dlls/dxgi/factory.c
+++ b/dlls/dxgi/factory.c
@@ -329,7 +329,7 @@ static HRESULT dxgi_factory_init(struct dxgi_factory *factory, BOOL extended)
     factory->refcount = 1;
 
     EnterCriticalSection(&dxgi_cs);
-    factory->wined3d = wined3d_create(10, 0);
+    factory->wined3d = wined3d_create(0);
     if (!factory->wined3d)
     {
         LeaveCriticalSection(&dxgi_cs);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index eaf2427..ef81278 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5204,9 +5204,8 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
     wined3d_null_wined3d_object_destroyed,
 };
 
-HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags)
+HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags)
 {
-    wined3d->dxVersion = version;
     wined3d->ref = 1;
     wined3d->flags = flags;
 
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 3a6dd33..3243f77 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -6,7 +6,7 @@
 @ cdecl wined3d_check_device_format_conversion(ptr long long long long)
 @ cdecl wined3d_check_device_multisample_type(ptr long long long long long ptr)
 @ cdecl wined3d_check_device_type(ptr long long long long long)
-@ cdecl wined3d_create(long long)
+@ cdecl wined3d_create(long)
 @ cdecl wined3d_decref(ptr)
 @ cdecl wined3d_enum_adapter_modes(ptr long long long long ptr)
 @ cdecl wined3d_get_adapter_count(ptr)
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index a0ecfa7..dae83d9 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -87,7 +87,7 @@ struct wined3d_settings wined3d_settings =
     FALSE,          /* 3D support enabled by default. */
 };
 
-struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
+struct wined3d * CDECL wined3d_create(DWORD flags)
 {
     struct wined3d *object;
     HRESULT hr;
@@ -99,10 +99,10 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
         return NULL;
     }
 
-    if (version == 7 && wined3d_settings.no_3d)
+    if (flags & WINED3D_ALLOW_3D_DISABLE && wined3d_settings.no_3d)
         flags |= WINED3D_NO3D;
 
-    hr = wined3d_init(object, version, flags);
+    hr = wined3d_init(object, flags);
     if (FAILED(hr))
     {
         WARN("Failed to initialize wined3d object, hr %#x.\n", hr);
@@ -110,7 +110,7 @@ struct wined3d * CDECL wined3d_create(UINT version, DWORD flags)
         return NULL;
     }
 
-    TRACE("Created wined3d object %p for d3d%d support.\n", object, version);
+    TRACE("Created wined3d object %p.\n", object);
 
     return object;
 }
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 3c23510..a6b4f1e 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1785,12 +1785,11 @@ struct wined3d
 {
     LONG ref;
     DWORD flags;
-    UINT dxVersion;
     UINT adapter_count;
     struct wined3d_adapter adapters[1];
 };
 
-HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags) DECLSPEC_HIDDEN;
+HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags) DECLSPEC_HIDDEN;
 BOOL wined3d_register_window(HWND window, struct wined3d_device *device) DECLSPEC_HIDDEN;
 void wined3d_unregister_window(HWND window) DECLSPEC_HIDDEN;
 
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index aaf92ef..5c22d7e 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1221,6 +1221,7 @@ enum wined3d_display_rotation
 #define WINED3D_NO3D                                            0x00000002
 #define WINED3D_VIDMEM_ACCOUNTING                               0x00000004
 #define WINED3D_PRESENT_CONVERSION                              0x00000008
+#define WINED3D_ALLOW_3D_DISABLE                                0x00000010
 
 #define WINED3D_RESZ_CODE                                       0x7fa05000
 
@@ -2024,7 +2025,7 @@ HRESULT __cdecl wined3d_check_device_multisample_type(const struct wined3d *wine
 HRESULT __cdecl wined3d_check_device_type(const struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_device_type device_type, enum wined3d_format_id display_format_id,
         enum wined3d_format_id backbuffer_format_id, BOOL windowed);
-struct wined3d * __cdecl wined3d_create(UINT version, DWORD flags);
+struct wined3d * __cdecl wined3d_create(DWORD flags);
 ULONG __cdecl wined3d_decref(struct wined3d *wined3d);
 HRESULT __cdecl wined3d_enum_adapter_modes(const struct wined3d *wined3d, UINT adapter_idx,
         enum wined3d_format_id format_id, enum wined3d_scanline_ordering scanline_ordering,
-- 
1.8.3.2




More information about the wine-patches mailing list