mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[d3d9] Handle invalid modes in Device::Reset
This commit is contained in:
parent
64c4eea922
commit
6071e998fd
@ -7079,8 +7079,10 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_implicitSwapchain != nullptr)
|
if (m_implicitSwapchain != nullptr) {
|
||||||
m_implicitSwapchain->Reset(pPresentationParameters, pFullscreenDisplayMode);
|
if (FAILED(m_implicitSwapchain->Reset(pPresentationParameters, pFullscreenDisplayMode)))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
m_implicitSwapchain = new D3D9SwapChainEx(this, pPresentationParameters, pFullscreenDisplayMode);
|
m_implicitSwapchain = new D3D9SwapChainEx(this, pPresentationParameters, pFullscreenDisplayMode);
|
||||||
|
|
||||||
|
@ -594,7 +594,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D9SwapChainEx::Reset(
|
HRESULT D3D9SwapChainEx::Reset(
|
||||||
D3DPRESENT_PARAMETERS* pPresentParams,
|
D3DPRESENT_PARAMETERS* pPresentParams,
|
||||||
D3DDISPLAYMODEEX* pFullscreenDisplayMode) {
|
D3DDISPLAYMODEEX* pFullscreenDisplayMode) {
|
||||||
D3D9DeviceLock lock = m_parent->LockDevice();
|
D3D9DeviceLock lock = m_parent->LockDevice();
|
||||||
@ -627,13 +627,17 @@ namespace dxvk {
|
|||||||
newRect.right - newRect.left, newRect.bottom - newRect.top, TRUE);
|
newRect.right - newRect.left, newRect.bottom - newRect.top, TRUE);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (changeFullscreen)
|
if (changeFullscreen) {
|
||||||
this->EnterFullscreenMode(pPresentParams, pFullscreenDisplayMode);
|
if (FAILED(this->EnterFullscreenMode(pPresentParams, pFullscreenDisplayMode)))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
D3D9WindowMessageFilter filter(m_window);
|
D3D9WindowMessageFilter filter(m_window);
|
||||||
|
|
||||||
if (!changeFullscreen)
|
if (!changeFullscreen) {
|
||||||
ChangeDisplayMode(pPresentParams, pFullscreenDisplayMode);
|
if (FAILED(ChangeDisplayMode(pPresentParams, pFullscreenDisplayMode)))
|
||||||
|
return D3DERR_INVALIDCALL;
|
||||||
|
}
|
||||||
|
|
||||||
// Move the window so that it covers the entire output
|
// Move the window so that it covers the entire output
|
||||||
RECT rect;
|
RECT rect;
|
||||||
@ -650,6 +654,8 @@ namespace dxvk {
|
|||||||
SetGammaRamp(0, &m_ramp);
|
SetGammaRamp(0, &m_ramp);
|
||||||
|
|
||||||
CreateBackBuffers(m_presentParams.BackBufferCount);
|
CreateBackBuffers(m_presentParams.BackBufferCount);
|
||||||
|
|
||||||
|
return D3D_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE GetDisplayModeEx(D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation);
|
HRESULT STDMETHODCALLTYPE GetDisplayModeEx(D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation);
|
||||||
|
|
||||||
void Reset(
|
HRESULT Reset(
|
||||||
D3DPRESENT_PARAMETERS* pPresentParams,
|
D3DPRESENT_PARAMETERS* pPresentParams,
|
||||||
D3DDISPLAYMODEEX* pFullscreenDisplayMode);
|
D3DDISPLAYMODEEX* pFullscreenDisplayMode);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user