Remove flicker when switching between native and full resolution from the gl config box. Remove a couple of unnecessary framebuffer binds.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@2623 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2009-03-08 21:42:27 +00:00
parent a9c79e4c5c
commit ab1aad3815
2 changed files with 8 additions and 6 deletions

View File

@ -544,7 +544,8 @@ void ConfigDialog::UpdateGUI()
{
// This is only used together with the aspect ratio options
m_Crop->Enable(g_Config.bKeepAR43 || g_Config.bKeepAR169);
if (g_Config.bUseXFB) {
if (g_Config.bUseXFB)
{
// XFB looks much better if the copy comes from native resolution.
g_Config.bNativeResolution = true;
m_NativeResolution->SetValue(true);

View File

@ -113,6 +113,7 @@ static bool s_bHaveFramebufferBlit = false;
static bool s_bHaveCoverageMSAA = false;
static bool g_bBlendSeparate = false;
static u32 s_blendMode;
static bool s_bNativeResolution = false;
static volatile bool s_bScreenshot = false;
static Common::CriticalSection s_criticalScreenshot;
@ -173,6 +174,7 @@ bool Renderer::Init()
bool bSuccess = true;
s_blendMode = 0;
s_MSAACoverageSamples = 0;
s_bNativeResolution = g_Config.bNativeResolution;
switch (g_Config.iMultisampleMode)
{
case MULTISAMPLE_OFF: s_MSAASamples = 1; break;
@ -540,12 +542,12 @@ bool Renderer::InitializeGL()
// ------------------------
int Renderer::GetTargetWidth()
{
return g_Config.bNativeResolution ? EFB_WIDTH : s_targetwidth;
return s_bNativeResolution ? EFB_WIDTH : s_targetwidth;
}
int Renderer::GetTargetHeight()
{
return g_Config.bNativeResolution ? EFB_HEIGHT : s_targetheight;
return s_bNativeResolution ? EFB_HEIGHT : s_targetheight;
}
float Renderer::GetTargetScaleX()
@ -591,7 +593,6 @@ GLuint Renderer::ResolveAndGetRenderTarget(const TRectangle &source_rect)
glBlitFramebufferEXT(flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, s_uFramebuffer);
// Return the resolved target.
return s_ResolvedRenderTarget;
@ -617,7 +618,6 @@ GLuint Renderer::ResolveAndGetFakeZTarget(const TRectangle &source_rect)
glBlitFramebufferEXT(flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
flipped_rect.left, flipped_rect.top, flipped_rect.right, flipped_rect.bottom,
GL_COLOR_BUFFER_BIT, GL_NEAREST);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, s_uFramebuffer);
// Return the resolved target.
return s_ResolvedFakeZTarget;
@ -841,7 +841,7 @@ void Renderer::FlushZBufferAlphaToTarget()
// TODO: This code should not have to bother with stretchtofit checking -
// all necessary scale initialization should be done elsewhere.
if (g_Config.bNativeResolution)
if (s_bNativeResolution)
{
//TODO: Do Correctly in a bit
float FactorW = 640.f / (float)OpenGL_GetBackbufferWidth();
@ -1123,6 +1123,7 @@ void Renderer::Swap(const TRectangle& rc)
// Place messages on the picture, then copy it to the screen
SwapBuffers();
s_bNativeResolution = g_Config.bNativeResolution;
RestoreGLState();