From a343ea0eb82fc573b636fe27156480b68e016f7b Mon Sep 17 00:00:00 2001 From: Roman C Date: Sun, 27 May 2007 14:38:20 +0000 Subject: [PATCH] - modified the syntax of the last commit, no semantic modifications git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1717 4a71c877-e1ca-e34f-864e-861f7616d084 --- src/main.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/src/main.c b/src/main.c index 88cc34a05..cbd03ec44 100644 --- a/src/main.c +++ b/src/main.c @@ -605,35 +605,32 @@ static void handleActiveEvent(SDL_Event * event) { // Ignore focus loss through SDL_APPMOUSEFOCUS, since it mostly happens accidentialy // active.state is a bitflag! Mixed events (eg. APPACTIVE|APPMOUSEFOCUS) will thus not be ignored. - if ( event->active.state != SDL_APPMOUSEFOCUS ) + if (!bMultiPlayer && event->active.state != SDL_APPMOUSEFOCUS ) { - if(!bMultiPlayer) //can't pause in multiplayer + if ( event->active.gain == 1 ) { - if ( event->active.gain == 1 ) + debug( LOG_NEVER, "WM_SETFOCUS\n"); + if (focusState != FOCUS_IN) { - debug( LOG_NEVER, "WM_SETFOCUS\n"); - if (focusState != FOCUS_IN) - { - focusState = FOCUS_IN; + focusState = FOCUS_IN; - gameTimeStart(); - // Should be: audio_ResumeAll(); - } + gameTimeStart(); + // Should be: audio_ResumeAll(); } - else + } + else + { + debug( LOG_NEVER, "WM_KILLFOCUS\n"); + if (focusState != FOCUS_OUT) { - debug( LOG_NEVER, "WM_KILLFOCUS\n"); - if (focusState != FOCUS_OUT) - { - focusState = FOCUS_OUT; + focusState = FOCUS_OUT; - gameTimeStop(); - // Should be: audio_PauseAll(); - audio_StopAll(); - } - /* Have to tell the input system that we've lost focus */ - inputLooseFocus(); + gameTimeStop(); + // Should be: audio_PauseAll(); + audio_StopAll(); } + /* Have to tell the input system that we've lost focus */ + inputLooseFocus(); } } }