mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Add being able to disable unfocus pause
It's sometimes unwanted by people, and it's unwanted enough that there exist instructions to hexedit the binary to remove it ( https://distractionware.com/forum/index.php?topic=3247.0 ). Fun fact, the unfocus pause didn't exist in 2.0.
This commit is contained in:
@@ -244,7 +244,10 @@ void KeyPoll::Poll()
|
||||
|
||||
/* Window Focus */
|
||||
case SDL_WINDOWEVENT_FOCUS_GAINED:
|
||||
isActive = true;
|
||||
if (!game.disablepause)
|
||||
{
|
||||
isActive = true;
|
||||
}
|
||||
if (!useFullscreenSpaces)
|
||||
{
|
||||
if (wasFullscreen)
|
||||
@@ -257,14 +260,17 @@ void KeyPoll::Poll()
|
||||
}
|
||||
}
|
||||
SDL_DisableScreenSaver();
|
||||
if (Mix_PlayingMusic())
|
||||
if (!game.disablepause && Mix_PlayingMusic())
|
||||
{
|
||||
// Correct songStart for how long we were paused
|
||||
music.songStart += SDL_GetPerformanceCounter() - pauseStart;
|
||||
}
|
||||
break;
|
||||
case SDL_WINDOWEVENT_FOCUS_LOST:
|
||||
isActive = false;
|
||||
if (!game.disablepause)
|
||||
{
|
||||
isActive = false;
|
||||
}
|
||||
if (!useFullscreenSpaces)
|
||||
{
|
||||
wasFullscreen = !graphics.screenbuffer->isWindowed;
|
||||
@@ -275,7 +281,10 @@ void KeyPoll::Poll()
|
||||
);
|
||||
}
|
||||
SDL_EnableScreenSaver();
|
||||
pauseStart = SDL_GetPerformanceCounter();
|
||||
if (!game.disablepause)
|
||||
{
|
||||
pauseStart = SDL_GetPerformanceCounter();
|
||||
}
|
||||
break;
|
||||
|
||||
/* Mouse Focus */
|
||||
|
||||
Reference in New Issue
Block a user