Commit 93af8d36 authored by Stefan Dösinger's avatar Stefan Dösinger Committed by Alexandre Julliard

d3d: Do not restore the display mode in ddraw.

parent 561ebb35
...@@ -305,6 +305,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DD ...@@ -305,6 +305,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreateAdditionalSwapChain(LPDIRECT3DD
localParameters.Flags = pPresentationParameters->Flags; localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval; localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
localParameters.AutoRestoreDisplayMode = TRUE;
EnterCriticalSection(&d3d8_cs); EnterCriticalSection(&d3d8_cs);
hrc = IWineD3DDevice_CreateSwapChain(This->WineD3DDevice, &localParameters, &object->wineD3DSwapChain, (IUnknown*)object, D3D8CB_CreateRenderTarget, D3D8CB_CreateDepthStencilSurface, SURFACE_OPENGL); 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 ...@@ -358,6 +359,7 @@ static HRESULT WINAPI IDirect3DDevice8Impl_Reset(LPDIRECT3DDEVICE8 iface, D3DPRE
localParameters.Flags = pPresentationParameters->Flags; localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval; localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
localParameters.AutoRestoreDisplayMode = TRUE;
EnterCriticalSection(&d3d8_cs); EnterCriticalSection(&d3d8_cs);
hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters); hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
......
...@@ -444,6 +444,7 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapte ...@@ -444,6 +444,7 @@ static HRESULT WINAPI IDirect3D8Impl_CreateDevice(LPDIRECT3D8 iface, UINT Adapte
localParameters.Flags = pPresentationParameters->Flags; localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval; localParameters.PresentationInterval = pPresentationParameters->FullScreen_PresentationInterval;
localParameters.AutoRestoreDisplayMode = TRUE;
if(BehaviourFlags & D3DCREATE_MULTITHREADED) { if(BehaviourFlags & D3DCREATE_MULTITHREADED) {
IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); IWineD3DDevice_SetMultithreaded(object->WineD3DDevice);
......
...@@ -376,6 +376,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9EX iface, D3 ...@@ -376,6 +376,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_Reset(LPDIRECT3DDEVICE9EX iface, D3
localParameters.Flags = pPresentationParameters->Flags; localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval; localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
localParameters.AutoRestoreDisplayMode = TRUE;
EnterCriticalSection(&d3d9_cs); EnterCriticalSection(&d3d9_cs);
hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters); hr = IWineD3DDevice_Reset(This->WineD3DDevice, &localParameters);
......
...@@ -515,6 +515,7 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap ...@@ -515,6 +515,7 @@ static HRESULT WINAPI IDirect3D9Impl_CreateDevice(LPDIRECT3D9EX iface, UINT Adap
localParameters.Flags = pPresentationParameters->Flags; localParameters.Flags = pPresentationParameters->Flags;
localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz; localParameters.FullScreen_RefreshRateInHz = pPresentationParameters->FullScreen_RefreshRateInHz;
localParameters.PresentationInterval = pPresentationParameters->PresentationInterval; localParameters.PresentationInterval = pPresentationParameters->PresentationInterval;
localParameters.AutoRestoreDisplayMode = TRUE;
if(BehaviourFlags & D3DCREATE_MULTITHREADED) { if(BehaviourFlags & D3DCREATE_MULTITHREADED) {
IWineD3DDevice_SetMultithreaded(object->WineD3DDevice); IWineD3DDevice_SetMultithreaded(object->WineD3DDevice);
......
...@@ -72,7 +72,7 @@ static void WINAPI IWineD3DSwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB ...@@ -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 * 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 * 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.Width = This->orig_width;
mode.Height = This->orig_height; mode.Height = This->orig_height;
mode.RefreshRate = 0; mode.RefreshRate = 0;
......
...@@ -59,7 +59,7 @@ static void WINAPI IWineGDISwapChainImpl_Destroy(IWineD3DSwapChain *iface, D3DCB ...@@ -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 * 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 * 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.Width = This->orig_width;
mode.Height = This->orig_height; mode.Height = This->orig_height;
mode.RefreshRate = 0; mode.RefreshRate = 0;
......
...@@ -886,6 +886,7 @@ typedef struct _WINED3DPRESENT_PARAMETERS { ...@@ -886,6 +886,7 @@ typedef struct _WINED3DPRESENT_PARAMETERS {
DWORD Flags; DWORD Flags;
UINT FullScreen_RefreshRateInHz; UINT FullScreen_RefreshRateInHz;
UINT PresentationInterval; UINT PresentationInterval;
BOOL AutoRestoreDisplayMode;
} WINED3DPRESENT_PARAMETERS; } WINED3DPRESENT_PARAMETERS;
#define WINED3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001 #define WINED3DPRESENTFLAG_LOCKABLE_BACKBUFFER 0x00000001
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment