Stefan Dösinger : d3d: Do not restore the display mode in ddraw.
Alexandre Julliard
julliard at winehq.org
Mon Nov 3 09:06:55 CST 2008
Module: wine
Branch: master
Commit: 93af8d363118b076600547622f5be57c08a300ee
URL: http://source.winehq.org/git/wine.git/?a=commit;h=93af8d363118b076600547622f5be57c08a300ee
Author: Stefan Dösinger <stefan at codeweavers.com>
Date: Sat Nov 1 22:35:23 2008 +0100
d3d: Do not restore the display mode in ddraw.
---
dlls/d3d8/device.c | 2 ++
dlls/d3d8/directx.c | 1 +
dlls/d3d9/device.c | 1 +
dlls/d3d9/directx.c | 1 +
dlls/wined3d/swapchain.c | 2 +-
dlls/wined3d/swapchain_gdi.c | 2 +-
include/wine/wined3d_types.h | 1 +
7 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c
index 04f56b8..e8df4f0 100644
--- a/dlls/d3d8/device.c
+++ b/dlls/d3d8/device.c
@@ -305,6 +305,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DD
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
+ localParameters.AutoRestoreDisplayMode = TRUE;
EnterCriticalSection(&d3d8_cs);
hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D8CB_CreateRenderTarget, D3D8CB_CreateDepthStencilSurface, SURFACE_OPENGL);
@@ -358,6 +359,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRE
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
+ localParameters.AutoRestoreDisplayMode = TRUE;
EnterCriticalSection(&d3d8_cs);
hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c
index afcb0fe..3efbab0 100644
--- a/dlls/d3d8/directx.c
+++ b/dlls/d3d8/directx.c
@@ -444,6 +444,7 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapte
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
+ localParameters.AutoRestoreDisplayMode = TRUE;
if(BehaviourFlags & D3DCREATE_MULTITHREADED) {
IWineD3DDevice_SetMultithreaded(object->WineD3DDevice);
diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c
index 8aab230..426c8ab 100644
--- a/dlls/d3d9/device.c
+++ b/dlls/d3d9/device.c
@@ -376,6 +376,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9EX iface, D3
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
+ localParameters.AutoRestoreDisplayMode = TRUE;
EnterCriticalSection(&d3d9_cs);
hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
diff --git a/dlls/d3d9/directx.c b/dlls/d3d9/directx.c
index b605f44..b44c632 100644
--- a/dlls/d3d9/directx.c
+++ b/dlls/d3d9/directx.c
@@ -515,6 +515,7 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap
localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
+ localParameters.AutoRestoreDisplayMode = TRUE;
if(BehaviourFlags & D3DCREATE_MULTITHREADED) {
IWineD3DDevice_SetMultithreaded(object->WineD3DDevice);
diff --git a/dlls/wined3d/swapchain.c b/dlls/wined3d/swapchain.c
index 74e1cf6..6f4393a 100644
--- a/dlls/wined3d/swapchain.c
+++ b/dlls/wined3d/swapchain.c
@@ -72,7 +72,7 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
* this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution
* before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params
*/
- if(This->presentParms.Windowed == FALSE) {
+ if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) {
mode.Width = This->orig_width;
mode.Height = This->orig_height;
mode.RefreshRate = 0;
diff --git a/dlls/wined3d/swapchain_gdi.c b/dlls/wined3d/swapchain_gdi.c
index f0ec4f2..f634e50 100644
--- a/dlls/wined3d/swapchain_gdi.c
+++ b/dlls/wined3d/swapchain_gdi.c
@@ -59,7 +59,7 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB
* this will be the original desktop resolution. In case of d3d7 this will be a NOP because ddraw sets the resolution
* before starting up Direct3D, thus orig_width and orig_height will be equal to the modes in the presentation params
*/
- if(This->presentParms.Windowed == FALSE) {
+ if(This->presentParms.Windowed == FALSE && This->presentParms.AutoRestoreDisplayMode) {
mode.Width = This->orig_width;
mode.Height = This->orig_height;
mode.RefreshRate = 0;
diff --git a/include/wine/wined3d_types.h b/include/wine/wined3d_types.h
index 4ccbcab..28e5525 100644
--- a/include/wine/wined3d_types.h
+++ b/include/wine/wined3d_types.h
@@ -886,6 +886,7 @@ typedef struct _WINED3DPRESENT_PARAMETERS {
DWORD Flags;
UINT FullScreen_RefreshRateInHz;
UINT PresentationInterval;
+ BOOL AutoRestoreDisplayMode;
} WINED3DPRESENT_PARAMETERS;
#define WINED3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001
More information about the wine-cvs
mailing list