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 = new GuiImage(gameScreen);
gameScreenImg->SetAlpha(192); gameScreenImg->SetAlpha(192);
gameScreenImg->ColorStripe(30); gameScreenImg->ColorStripe(30);
if (GCSettings.render > 0 && !GCSettings.widescreen)
gameScreenImg->SetScaleX(screenwidth/(vmode->fbWidth*0.8));
else
gameScreenImg->SetScaleX(screenwidth/(float)vmode->fbWidth); gameScreenImg->SetScaleX(screenwidth/(float)vmode->fbWidth);
gameScreenImg->SetScaleY(screenheight/(float)vmode->efbHeight); gameScreenImg->SetScaleY(screenheight/(float)vmode->efbHeight);
} }
else else

View File

@ -569,6 +569,21 @@ InitGCVideo ()
vheight = 100; 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 * ResetVideo_Emu
* *
@ -617,12 +632,10 @@ ResetVideo_Emu ()
{ {
rmode = FindVideoMode(); rmode = FindVideoMode();
if (!GCSettings.widescreen) if (GCSettings.widescreen)
{ ResetFbWidth(640, rmode);
memcpy(&TV_Custom, rmode, sizeof(TV_Custom)); else
rmode = &TV_Custom; ResetFbWidth(512, rmode);
rmode->fbWidth = 512;
}
Settings.SoundInputRate = 31953; Settings.SoundInputRate = 31953;
UpdatePlaybackRate(); UpdatePlaybackRate();