Henri Verbeet : wined3d: Request per-surface palettes in the client libs.

Alexandre Julliard julliard at winehq.org
Fri Jun 24 13:53:59 CDT 2011


Module: wine
Branch: master
Commit: c461d312ba73e4b19dcf88d76bd039e756aeddf0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c461d312ba73e4b19dcf88d76bd039e756aeddf0

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Jun 23 11:43:40 2011 +0200

wined3d: Request per-surface palettes in the client libs.

---

 dlls/d3d8/d3d8_main.c          |    2 +-
 dlls/d3d9/d3d9_main.c          |    2 +-
 dlls/ddraw/ddraw.c             |    2 +-
 dlls/dxgi/factory.c            |    2 +-
 dlls/wined3d/directx.c         |    3 ++-
 dlls/wined3d/surface.c         |    4 +---
 dlls/wined3d/wined3d.spec      |    2 +-
 dlls/wined3d/wined3d_main.c    |    4 ++--
 dlls/wined3d/wined3d_private.h |    3 ++-
 include/wine/wined3d.h         |    4 +++-
 10 files changed, 15 insertions(+), 13 deletions(-)

diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index 7a25a93..9b1ad37 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -45,7 +45,7 @@ IDirect3D8* WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT SDKVersion) {
 
     object->IDirect3D8_iface.lpVtbl = &Direct3D8_Vtbl;
     object->ref = 1;
-    object->WineD3D = wined3d_create(8, &object->IDirect3D8_iface);
+    object->WineD3D = wined3d_create(8, 0, &object->IDirect3D8_iface);
 
     TRACE("Created Direct3D object @ %p, WineObj @ %p\n", object, object->WineD3D);
 
diff --git a/dlls/d3d9/d3d9_main.c b/dlls/d3d9/d3d9_main.c
index 0d3ecec..abb98f3 100644
--- a/dlls/d3d9/d3d9_main.c
+++ b/dlls/d3d9/d3d9_main.c
@@ -40,7 +40,7 @@ IDirect3D9* WINAPI DECLSPEC_HOTPATCH Direct3DCreate9(UINT SDKVersion) {
     object->ref = 1;
 
     wined3d_mutex_lock();
-    object->WineD3D = wined3d_create(9, object);
+    object->WineD3D = wined3d_create(9, 0, object);
     wined3d_mutex_unlock();
 
     TRACE("SDKVersion = %x, Created Direct3D object @ %p, WineObj @ %p\n", SDKVersion, object, object->WineD3D);
diff --git a/dlls/ddraw/ddraw.c b/dlls/ddraw/ddraw.c
index 7014ee8..c3e1a38 100644
--- a/dlls/ddraw/ddraw.c
+++ b/dlls/ddraw/ddraw.c
@@ -6034,7 +6034,7 @@ HRESULT ddraw_init(IDirectDrawImpl *ddraw, WINED3DDEVTYPE device_type)
     ddraw->orig_width = GetSystemMetrics(SM_CXSCREEN);
     ddraw->orig_height = GetSystemMetrics(SM_CYSCREEN);
 
-    ddraw->wineD3D = wined3d_create(7, &ddraw->IDirectDraw7_iface);
+    ddraw->wineD3D = wined3d_create(7, WINED3D_PALETTE_PER_SURFACE, &ddraw->IDirectDraw7_iface);
     if (!ddraw->wineD3D)
     {
         WARN("Failed to create a wined3d object.\n");
diff --git a/dlls/dxgi/factory.c b/dlls/dxgi/factory.c
index dd1ec5e..c7a11cf 100644
--- a/dlls/dxgi/factory.c
+++ b/dlls/dxgi/factory.c
@@ -303,7 +303,7 @@ HRESULT dxgi_factory_init(struct dxgi_factory *factory)
     factory->refcount = 1;
 
     EnterCriticalSection(&dxgi_cs);
-    factory->wined3d = wined3d_create(10, factory);
+    factory->wined3d = wined3d_create(10, 0, factory);
     if (!factory->wined3d)
     {
         LeaveCriticalSection(&dxgi_cs);
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index ceaef32..f45ff04 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -5370,11 +5370,12 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
 };
 
 /* Do not call while under the GL lock. */
-HRESULT wined3d_init(struct wined3d *wined3d, UINT version, void *parent)
+HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags, void *parent)
 {
     wined3d->dxVersion = version;
     wined3d->ref = 1;
     wined3d->parent = parent;
+    wined3d->flags = flags;
 
     if (!InitAdapters(wined3d))
     {
diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c
index 247d413..114be69 100644
--- a/dlls/wined3d/surface.c
+++ b/dlls/wined3d/surface.c
@@ -4260,10 +4260,8 @@ void d3dfmt_p8_init_palette(struct wined3d_surface *surface, BYTE table[256][4],
 
     if (!pal)
     {
-        UINT dxVersion = device->wined3d->dxVersion;
-
         /* In DirectDraw the palette is a property of the surface, there are no such things as device palettes. */
-        if (dxVersion <= 7)
+        if (device->wined3d->flags & WINED3D_PALETTE_PER_SURFACE)
         {
             ERR("This code should never get entered for DirectDraw!, expect problems\n");
             if (index_in_alpha)
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 2cbd57c..62efc26 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 ptr)
+@ cdecl wined3d_create(long long ptr)
 @ cdecl wined3d_decref(ptr)
 @ cdecl wined3d_enum_adapter_modes(ptr 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 ad3643d..5976c83 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -88,7 +88,7 @@ struct wined3d_settings wined3d_settings =
 };
 
 /* Do not call while under the GL lock. */
-struct wined3d * CDECL wined3d_create(UINT version, void *parent)
+struct wined3d * CDECL wined3d_create(UINT version, DWORD flags, void *parent)
 {
     struct wined3d *object;
     HRESULT hr;
@@ -100,7 +100,7 @@ struct wined3d * CDECL wined3d_create(UINT version, void *parent)
         return NULL;
     }
 
-    hr = wined3d_init(object, version, parent);
+    hr = wined3d_init(object, version, flags, parent);
     if (FAILED(hr))
     {
         WARN("Failed to initialize wined3d object, hr %#x.\n", hr);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index cc75cde..e96b7ad 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -1634,12 +1634,13 @@ struct wined3d
 {
     LONG ref;
     void *parent;
+    DWORD flags;
     UINT dxVersion;
     UINT adapter_count;
     struct wined3d_adapter adapters[1];
 };
 
-HRESULT wined3d_init(struct wined3d *wined3d, UINT version, void *parent) DECLSPEC_HIDDEN;
+HRESULT wined3d_init(struct wined3d *wined3d, UINT version, DWORD flags, void *parent) 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 0065441..6a01f87 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -1235,6 +1235,8 @@ enum wined3d_sysval_semantic
 #define WINED3DDEVCAPS_RTPATCHHANDLEZERO                        0x00800000
 #define WINED3DDEVCAPS_NPATCHES                                 0x01000000
 
+#define WINED3D_PALETTE_PER_SURFACE                             0x00000001
+
 /* dwDDFX */
 /* arithmetic stretching along y axis */
 #define WINEDDBLTFX_ARITHSTRETCHY                               0x00000001
@@ -2125,7 +2127,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,
         WINED3DDEVTYPE device_type, enum wined3d_format_id display_format_id,
         enum wined3d_format_id backbuffer_format_id, BOOL windowed);
-struct wined3d * __cdecl wined3d_create(UINT dxVersion, void *parent);
+struct wined3d * __cdecl wined3d_create(UINT dxVersion, DWORD flags, void *parent);
 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, UINT mode_idx, WINED3DDISPLAYMODE *mode);




More information about the wine-cvs mailing list