quick fix for MP games, only tested mp1 but my solve mp2 issues to
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4846 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
0a88519ecf
commit
c62fb1d7d2
|
@ -640,8 +640,8 @@ bool Renderer::SetScissorRect()
|
|||
//WARN_LOG(VIDEO, "Bad scissor rectangle: %i %i %i %i", rc.left, rc.top, rc.right, rc.bottom);
|
||||
rc.left = Xstride;
|
||||
rc.top = Ystride;
|
||||
rc.right = GetTargetWidth();
|
||||
rc.bottom = GetTargetHeight();
|
||||
rc.right = Xstride + GetTargetWidth();
|
||||
rc.bottom = Ystride + GetTargetHeight();
|
||||
D3D::dev->SetScissorRect(&rc);
|
||||
return false;
|
||||
}
|
||||
|
@ -917,13 +917,13 @@ void Renderer::ClearScreen(const EFBRectangle& rc, bool colorEnable, bool alphaE
|
|||
sirc.bottom = targetRc.bottom;
|
||||
D3D::dev->SetScissorRect(&sirc);
|
||||
if(zEnable)
|
||||
D3D::SetRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
|
||||
D3D::ChangeRenderState(D3DRS_ZFUNC, D3DCMP_ALWAYS);
|
||||
D3D::drawClearQuad(&sirc,color ,(z & 0xFFFFFF) / float(0xFFFFFF),PixelShaderCache::GetClearProgram(),VertexShaderCache::GetSimpleVertexShader());
|
||||
if(zEnable)
|
||||
D3D::SetRenderState(D3DRS_ZFUNC, d3dCmpFuncs[bpmem.zmode.func]);
|
||||
D3D::RefreshRenderState(D3DRS_ZFUNC);
|
||||
//D3D::dev->Clear(0, NULL, (colorEnable ? D3DCLEAR_TARGET : 0)| ( zEnable ? D3DCLEAR_ZBUFFER : 0), color | ((alphaEnable)?0:0xFF000000),(z & 0xFFFFFF) / float(0xFFFFFF), 0);
|
||||
SetScissorRect();
|
||||
UpdateViewport();
|
||||
SetScissorRect();
|
||||
}
|
||||
|
||||
void Renderer::SetBlendMode(bool forceUpdate)
|
||||
|
@ -1013,25 +1013,25 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight)
|
|||
|
||||
void Renderer::ResetAPIState()
|
||||
{
|
||||
D3D::ChangeRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
|
||||
D3D::ChangeRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
|
||||
D3D::ChangeRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
|
||||
D3D::ChangeRenderState(D3DRS_ZENABLE, FALSE);
|
||||
D3D::ChangeRenderState(D3DRS_ZWRITEENABLE, FALSE);
|
||||
D3D::SetRenderState(D3DRS_SCISSORTESTENABLE, FALSE);
|
||||
D3D::SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE);
|
||||
D3D::SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE);
|
||||
D3D::SetRenderState(D3DRS_ZENABLE, FALSE);
|
||||
D3D::SetRenderState(D3DRS_ZWRITEENABLE, FALSE);
|
||||
DWORD color_mask = D3DCOLORWRITEENABLE_ALPHA| D3DCOLORWRITEENABLE_RED | D3DCOLORWRITEENABLE_GREEN | D3DCOLORWRITEENABLE_BLUE;
|
||||
D3D::ChangeRenderState(D3DRS_COLORWRITEENABLE, color_mask);
|
||||
D3D::SetRenderState(D3DRS_COLORWRITEENABLE, color_mask);
|
||||
}
|
||||
|
||||
void Renderer::RestoreAPIState()
|
||||
{
|
||||
// Gets us back into a more game-like state.
|
||||
D3D::RefreshRenderState(D3DRS_SCISSORTESTENABLE);
|
||||
D3D::RefreshRenderState(D3DRS_CULLMODE);
|
||||
D3D::RefreshRenderState(D3DRS_ALPHABLENDENABLE);
|
||||
D3D::RefreshRenderState(D3DRS_ZENABLE);
|
||||
D3D::RefreshRenderState(D3DRS_ZWRITEENABLE);
|
||||
D3D::RefreshRenderState(D3DRS_COLORWRITEENABLE);
|
||||
D3D::SetRenderState(D3DRS_SCISSORTESTENABLE, TRUE);
|
||||
UpdateViewport();
|
||||
SetScissorRect();
|
||||
if (bpmem.zmode.testenable) D3D::SetRenderState(D3DRS_ZENABLE, TRUE);
|
||||
if (bpmem.zmode.updateenable) D3D::SetRenderState(D3DRS_ZWRITEENABLE, TRUE);
|
||||
SetColorMask();
|
||||
SetLogicOpMode();
|
||||
}
|
||||
|
||||
void Renderer::SetGenerationMode()
|
||||
|
|
Loading…
Reference in New Issue