mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
D3D viewport fix to get rid of the black borders. Seems to work fine in Window mode, not working yet for full screen mode.
Also a minor fix for the command line switches to specify pad and wiimote plugins. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4215 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -317,11 +317,15 @@ bool DolphinApp::OnInit()
|
|||||||
}
|
}
|
||||||
if (selectPadPlugin && padPluginFilename != wxEmptyString)
|
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)
|
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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
|
|
||||||
#include "D3DBase.h"
|
#include "D3DBase.h"
|
||||||
#include "Render.h"
|
#include "Render.h"
|
||||||
|
#include "XFStructs.h"
|
||||||
|
|
||||||
|
|
||||||
namespace D3D
|
namespace D3D
|
||||||
@ -107,15 +108,14 @@ namespace D3D
|
|||||||
|
|
||||||
pp->MultiSampleType = adapters[adapter].aa_levels[aa_mode].ms_setting;
|
pp->MultiSampleType = adapters[adapter].aa_levels[aa_mode].ms_setting;
|
||||||
pp->MultiSampleQuality = adapters[adapter].aa_levels[aa_mode].qual_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)
|
if (fullScreen)
|
||||||
{
|
{
|
||||||
xres = pp->BackBufferWidth = FSResX;
|
xres = pp->BackBufferWidth = FSResX;
|
||||||
yres = pp->BackBufferHeight = FSResY;
|
yres = pp->BackBufferHeight = FSResY;
|
||||||
pp->SwapEffect = D3DSWAPEFFECT_DISCARD;
|
//pp->SwapEffect = D3DSWAPEFFECT_DISCARD;
|
||||||
|
pp->SwapEffect = D3DSWAPEFFECT_COPY;
|
||||||
pp->Windowed = FALSE;
|
pp->Windowed = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -123,7 +123,8 @@ namespace D3D
|
|||||||
GetClientRect(hWnd, &client);
|
GetClientRect(hWnd, &client);
|
||||||
xres = pp->BackBufferWidth = client.right - client.left;
|
xres = pp->BackBufferWidth = client.right - client.left;
|
||||||
yres = pp->BackBufferHeight = client.bottom - client.top;
|
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->PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
|
||||||
pp->Windowed = TRUE;
|
pp->Windowed = TRUE;
|
||||||
}
|
}
|
||||||
@ -396,7 +397,16 @@ namespace D3D
|
|||||||
if (dev)
|
if (dev)
|
||||||
{
|
{
|
||||||
dev->EndScene();
|
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)
|
if (fullScreen != nextFullScreen)
|
||||||
|
Reference in New Issue
Block a user