Index: binaries/data/mods/public/gui/options/options.json =================================================================== --- binaries/data/mods/public/gui/options/options.json +++ binaries/data/mods/public/gui/options/options.json @@ -22,10 +22,16 @@ "config": "windowed" }, { - "type": "boolean", + "type": "dropdown", "label": "Background Pause", - "tooltip": "Pause single player games when window loses focus", - "config": "pauseonfocusloss" + "tooltip": "Pause single player games or pause rendering when window loses focus.", + "config": "pauseonfocusloss", + "list": [ + { "value": "0", "label": "Disabled" }, + { "value": "1", "label": "Pause Game" }, + { "value": "2", "label": "Pause Game or Renderer" }, + { "value": "3", "label": "Pause Renderer" } + ] }, { "type": "boolean", Index: source/main.cpp =================================================================== --- source/main.cpp +++ source/main.cpp @@ -305,7 +305,7 @@ ENSURE(realTimeSinceLastFrame > 0.0f); // decide if update/render is necessary - bool need_render = !g_app_minimized; + bool need_render = !g_app_minimized && (!g_PauseRendererOnFocusLoss || g_app_has_focus); bool need_update = true; // If we are not running a multiplayer game, disable updates when the game is Index: source/ps/GameSetup/Config.h =================================================================== --- source/ps/GameSetup/Config.h +++ source/ps/GameSetup/Config.h @@ -44,6 +44,9 @@ // flag to pause the game on window focus loss extern bool g_PauseOnFocusLoss; +// flag to pause the renderer on window focus loss +extern bool g_PauseRendererOnFocusLoss; + // flag to switch on actor rendering extern bool g_RenderActors; Index: source/ps/GameSetup/Config.cpp =================================================================== --- source/ps/GameSetup/Config.cpp +++ source/ps/GameSetup/Config.cpp @@ -36,6 +36,7 @@ bool g_NoGLVBO = false; bool g_PauseOnFocusLoss = false; +bool g_PauseRendererOnFocusLoss = false; bool g_RenderActors = true; @@ -92,7 +93,23 @@ CFG_GET_VAL("nos3tc", g_NoGLS3TC); CFG_GET_VAL("noautomipmap", g_NoGLAutoMipmap); CFG_GET_VAL("novbo", g_NoGLVBO); - CFG_GET_VAL("pauseonfocusloss", g_PauseOnFocusLoss); + + int pauseOnFocusLoss = 0; + CFG_GET_VAL("pauseonfocusloss", pauseOnFocusLoss); + switch (pauseOnFocusLoss) + { + case 3: + g_PauseRendererOnFocusLoss = true; + break; + case 2: + g_PauseRendererOnFocusLoss = true; + case 1: + g_PauseOnFocusLoss = true; + break; + default: + break; + } + CFG_GET_VAL("renderactors", g_RenderActors); CFG_GET_VAL("shadows", g_Shadows); CFG_GET_VAL("shadowpcf", g_ShadowPCF);