Ticket #1025: 0AD_PauseOnFocusLoss.patch

File 0AD_PauseOnFocusLoss.patch, 2.6 KB (added by Mark Cho, 12 years ago)
  • binaries/data/config/default.cfg

     
    1616; Enable/disable windowed mode by default. (Use Alt+Enter to toggle in the game.)
    1717windowed = false
    1818
     19; Pause the game on window focus loss (Only applicable to single player mode)
     20pauseonfocusloss = false
     21
    1922; Force a particular resolution. (If these are 0, the default is
    2023; to keep the current desktop resolution in fullscreen mode or to
    2124; use 1024x768 in windowed mode.)
  • source/main.cpp

     
    292292    // If we are not running a multiplayer game, disable updates when the game is
    293293    // minimized or out of focus and relinquish the CPU a bit, in order to make
    294294    // debugging easier.
    295     if( !g_NetClient && !g_app_has_focus )
     295    if( g_PauseOnFocusLoss && !g_NetClient && !g_app_has_focus )
    296296    {
    297297        PROFILE3("non-focus delay");
    298298        need_update = false;
  • source/ps/GameSetup/Config.cpp

     
    3333bool g_NoGLAutoMipmap = false;
    3434bool g_NoGLVBO = false;
    3535
     36bool g_PauseOnFocusLoss = false;
     37
    3638bool g_Shadows = false;
    3739bool g_ShadowPCF = false;
    3840bool g_FancyWater = false;
     
    7274    CFG_GET_USER_VAL("nos3tc", Bool, g_NoGLS3TC);
    7375    CFG_GET_USER_VAL("noautomipmap", Bool, g_NoGLAutoMipmap);
    7476    CFG_GET_USER_VAL("novbo", Bool, g_NoGLVBO);
     77    CFG_GET_USER_VAL("pauseonfocusloss", Bool, g_PauseOnFocusLoss);
    7578    CFG_GET_USER_VAL("shadows", Bool, g_Shadows);
    7679    CFG_GET_USER_VAL("shadowpcf", Bool, g_ShadowPCF);
    7780    CFG_GET_USER_VAL("fancywater", Bool, g_FancyWater);
  • source/ps/GameSetup/Config.h

     
    1 /* Copyright (C) 2010 Wildfire Games.
     1/* Copyright (C) 2011 Wildfire Games.
    22 * This file is part of 0 A.D.
    33 *
    44 * 0 A.D. is free software: you can redistribute it and/or modify
     
    4141
    4242//-----------------------------------------------------------------------------
    4343
     44// flag to pause the game on window focus loss
     45extern bool g_PauseOnFocusLoss;
     46
    4447// flag to switch on shadows
    4548extern bool g_Shadows;
    4649// flag to switch on reflective/refractive water