sdl: pause before switching to fullscreen; resume when switch is complete

This commit is contained in:
punkrockguy318 2011-03-31 00:26:22 +00:00
parent b5c95f8a82
commit ee980142f5
1 changed files with 8 additions and 0 deletions

View File

@ -494,6 +494,11 @@ InitVideo(FCEUGI *gi)
void void
ToggleFS() ToggleFS()
{ {
// pause while we we are making the switch
bool paused = FCEUI_EmulationPaused();
if(!paused)
FCEUI_ToggleEmulationPause();
int error, fullscreen = s_fullscreen; int error, fullscreen = s_fullscreen;
// shut down the current video system // shut down the current video system
@ -514,6 +519,9 @@ ToggleFS()
g_config->setOption("SDL.Fullscreen", fullscreen); g_config->setOption("SDL.Fullscreen", fullscreen);
InitVideo(GameInfo); InitVideo(GameInfo);
} }
// if we paused to make the switch; unpause
if(!paused)
FCEUI_ToggleEmulationPause();
} }
static SDL_Color s_psdl[256]; static SDL_Color s_psdl[256];