fix screen flicker when going back to menu

This commit is contained in:
dborth 2012-06-28 02:33:17 +00:00
parent f8caf2e9df
commit 36b33a261c
2 changed files with 22 additions and 14 deletions

View File

@ -3782,12 +3782,7 @@ MainMenu (int menu)
gameScreenImg = new GuiImage(gameScreen);
gameScreenImg->SetAlpha(192);
gameScreenImg->ColorStripe(30);
if (GCSettings.render > 0 && !GCSettings.widescreen)
gameScreenImg->SetScaleX(screenwidth/(vmode->fbWidth*0.8));
else
gameScreenImg->SetScaleX(screenwidth/(float)vmode->fbWidth);
gameScreenImg->SetScaleY(screenheight/(float)vmode->efbHeight);
}
else

View File

@ -569,6 +569,21 @@ InitGCVideo ()
vheight = 100;
}
void ResetFbWidth(int width, GXRModeObj *rmode)
{
if(rmode->fbWidth == width)
return;
rmode->fbWidth = width;
if(rmode != vmode)
return;
GX_InvVtxCache();
VIDEO_Configure(rmode);
VIDEO_Flush();
}
/****************************************************************************
* ResetVideo_Emu
*
@ -617,12 +632,10 @@ ResetVideo_Emu ()
{
rmode = FindVideoMode();
if (!GCSettings.widescreen)
{
memcpy(&TV_Custom, rmode, sizeof(TV_Custom));
rmode = &TV_Custom;
rmode->fbWidth = 512;
}
if (GCSettings.widescreen)
ResetFbWidth(640, rmode);
else
ResetFbWidth(512, rmode);
Settings.SoundInputRate = 31953;
UpdatePlaybackRate();