1
1
forked from 0ad/0ad

Fix #1025 (add config option to toggle pause on window focus loss), based on patch by markcho.

This was SVN commit r10609.
This commit is contained in:
Ykkrosh 2011-11-26 15:23:41 +00:00
parent 565e9aa8a7
commit d82b85b8f3
4 changed files with 11 additions and 2 deletions

View File

@ -16,6 +16,9 @@
; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.)
windowed = false
; Pause the game on window focus loss (Only applicable to single player mode)
pauseonfocusloss = true
; Force a particular resolution. (If these are 0, the default is
; to keep the current desktop resolution in fullscreen mode or to
; use 1024x768 in windowed mode.)

View File

@ -292,7 +292,7 @@ static void Frame()
// If we are not running a multiplayer game, disable updates when the game is
// minimized or out of focus and relinquish the CPU a bit, in order to make
// debugging easier.
if( !g_NetClient && !g_app_has_focus )
if( g_PauseOnFocusLoss && !g_NetClient && !g_app_has_focus )
{
PROFILE3("non-focus delay");
need_update = false;

View File

@ -33,6 +33,8 @@ bool g_NoGLS3TC = false;
bool g_NoGLAutoMipmap = false;
bool g_NoGLVBO = false;
bool g_PauseOnFocusLoss = false;
bool g_Shadows = false;
bool g_ShadowPCF = false;
bool g_FancyWater = false;
@ -72,6 +74,7 @@ static void LoadGlobals()
CFG_GET_USER_VAL("nos3tc", Bool, g_NoGLS3TC);
CFG_GET_USER_VAL("noautomipmap", Bool, g_NoGLAutoMipmap);
CFG_GET_USER_VAL("novbo", Bool, g_NoGLVBO);
CFG_GET_USER_VAL("pauseonfocusloss", Bool, g_PauseOnFocusLoss);
CFG_GET_USER_VAL("shadows", Bool, g_Shadows);
CFG_GET_USER_VAL("shadowpcf", Bool, g_ShadowPCF);
CFG_GET_USER_VAL("fancywater", Bool, g_FancyWater);

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010 Wildfire Games.
/* Copyright (C) 2011 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@ -41,6 +41,9 @@ extern bool g_NoGLVBO;
//-----------------------------------------------------------------------------
// flag to pause the game on window focus loss
extern bool g_PauseOnFocusLoss;
// flag to switch on shadows
extern bool g_Shadows;
// flag to switch on reflective/refractive water