From 8eaed1c105d2ecd3c63cc728eee8bc1a493a27db Mon Sep 17 00:00:00 2001 From: Matt Callaghan Date: Mon, 21 Mar 2011 03:39:28 +0000 Subject: [PATCH] Partial fix for 3D Vision. It now works in the debug builds, but not in release builds for some reason. I'm not used to big projects like this so it's probably something obvious that I'm missing. Exclusive full screen mode seems to need the fullscreen resolution for the backbuffer when the DX device is created, so I used adapters[adapter].resolutions[f].xres and yres to get that, but in release builds, that gives me the windowed resolution (in debug it give me the fullscreen res, like I believe it's supposed to), which it reallly doesn't like. It's not a difficult fix probably, but I've been staring at my monitor in confusion for too long now and need to get to bed. If anyone wants to test, you can still enable the 3D Vision option, it just wouldn't be 3D (obviously). git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7385 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/VideoCommon/Src/EmuWindow.cpp | 11 +++++++++-- Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp | 16 ++++++++++++---- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Source/Core/VideoCommon/Src/EmuWindow.cpp b/Source/Core/VideoCommon/Src/EmuWindow.cpp index 9cf1b497a1..0e1c1b3992 100644 --- a/Source/Core/VideoCommon/Src/EmuWindow.cpp +++ b/Source/Core/VideoCommon/Src/EmuWindow.cpp @@ -176,7 +176,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam ) { // This basically throws away the left button down input when b3DVision is activated so WX // can't get access to it, stopping focus pulling on mouse click. - // (Input plugins use a different system so it doesn't cause any weirdness) + // (Input plugins use a different system so it doesn't cause too much weirdness) break; } case WM_LBUTTONUP: @@ -309,7 +309,14 @@ void Show() ShowWindow(m_hWnd, SW_SHOW); BringWindowToTop(m_hWnd); UpdateWindow(m_hWnd); - SetFocus(m_hParent); + + if(g_ActiveConfig.backend_info.bSupports3DVision && g_ActiveConfig.b3DVision) + { + SetActiveWindow(m_hParent); + SetFocus(m_hWnd); + } + else + SetFocus(m_hParent); } HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp index e63e05e802..da06c44570 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp @@ -185,10 +185,18 @@ void InitPP(int adapter, int f, int aa_mode, D3DPRESENT_PARAMETERS *pp) pp->Flags = auto_depth_stencil ? D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL : 0; - RECT client; - GetClientRect(hWnd, &client); - xres = pp->BackBufferWidth = client.right - client.left; - yres = pp->BackBufferHeight = client.bottom - client.top; + if(g_Config.b3DVision) + { + xres = pp->BackBufferWidth = adapters[adapter].resolutions[f].xres; + yres = pp->BackBufferHeight = adapters[adapter].resolutions[f].yres; + } + else + { + RECT client; + GetClientRect(hWnd, &client); + xres = pp->BackBufferWidth = client.right - client.left; + yres = pp->BackBufferHeight = client.bottom - client.top; + } pp->SwapEffect = D3DSWAPEFFECT_DISCARD; pp->PresentationInterval = g_Config.bVSync ? D3DPRESENT_INTERVAL_DEFAULT : D3DPRESENT_INTERVAL_IMMEDIATE; pp->Windowed = !g_Config.b3DVision;