diff --git a/Source/Core/DolphinWX/Src/Main.cpp b/Source/Core/DolphinWX/Src/Main.cpp index 4fe7b26732..24d33c6271 100644 --- a/Source/Core/DolphinWX/Src/Main.cpp +++ b/Source/Core/DolphinWX/Src/Main.cpp @@ -317,11 +317,15 @@ bool DolphinApp::OnInit() } if (selectPadPlugin && padPluginFilename != wxEmptyString) { - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[0] = std::string(padPluginFilename.mb_str()); + int k; + for(k=0;k<4;k++) + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strPadPlugin[k] = std::string(padPluginFilename.mb_str()); } if (selectWiimotePlugin && wiimotePluginFilename != wxEmptyString) { - SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[0] = std::string(wiimotePluginFilename.mb_str()); + int k; + for(k=0;k<4;k++) + SConfig::GetInstance().m_LocalCoreStartupParameter.m_strWiimotePlugin[k] = std::string(wiimotePluginFilename.mb_str()); } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp index 6f85bc9c51..4ba9427b9a 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/D3DBase.cpp @@ -17,6 +17,7 @@ #include "D3DBase.h" #include "Render.h" +#include "XFStructs.h" namespace D3D @@ -107,15 +108,14 @@ namespace D3D pp->MultiSampleType = adapters[adapter].aa_levels[aa_mode].ms_setting; pp->MultiSampleQuality = adapters[adapter].aa_levels[aa_mode].qual_setting; - pp->Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL; - //D3DPRESENTFLAG_LOCKABLE_BACKBUFFER - + //pp->Flags = D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL; if (fullScreen) { xres = pp->BackBufferWidth = FSResX; yres = pp->BackBufferHeight = FSResY; - pp->SwapEffect = D3DSWAPEFFECT_DISCARD; + //pp->SwapEffect = D3DSWAPEFFECT_DISCARD; + pp->SwapEffect = D3DSWAPEFFECT_COPY; pp->Windowed = FALSE; } else @@ -123,7 +123,8 @@ namespace D3D GetClientRect(hWnd, &client); xres = pp->BackBufferWidth = client.right - client.left; yres = pp->BackBufferHeight = client.bottom - client.top; - pp->SwapEffect = D3DSWAPEFFECT_DISCARD; + //pp->SwapEffect = D3DSWAPEFFECT_DISCARD; + pp->SwapEffect = D3DSWAPEFFECT_COPY; pp->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; pp->Windowed = TRUE; } @@ -396,7 +397,16 @@ namespace D3D if (dev) { dev->EndScene(); - dev->Present( NULL, NULL, NULL, NULL ); + + // copying the content from the backbuffer to the front buffer + // and adjust the aspect ratio + // The buffers are created with D3DSWAPEFFECT_COPY, otherwise the rescaling won't work + + int Width = (int)ceil(abs((int)(2 * xfregs.rawViewport[0])) * Renderer::GetTargetScaleX()); + int Height = (int)ceil(abs((int)(2 * xfregs.rawViewport[1])) * Renderer::GetTargetScaleY()); + + RECT src={0,0,Width,Height}; + dev->Present( &src, NULL, NULL, NULL ); } if (fullScreen != nextFullScreen)