- prevent wz from pausing in multiplayer when focus is lost
git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@1716 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
02c6705f61
commit
b2bcb79c99
37
src/main.c
37
src/main.c
|
@ -607,30 +607,33 @@ static void handleActiveEvent(SDL_Event * event)
|
|||
// active.state is a bitflag! Mixed events (eg. APPACTIVE|APPMOUSEFOCUS) will thus not be ignored.
|
||||
if ( event->active.state != SDL_APPMOUSEFOCUS )
|
||||
{
|
||||
if ( event->active.gain == 1 )
|
||||
if(!bMultiPlayer) //can't pause in multiplayer
|
||||
{
|
||||
debug( LOG_NEVER, "WM_SETFOCUS\n");
|
||||
if (focusState != FOCUS_IN)
|
||||
if ( event->active.gain == 1 )
|
||||
{
|
||||
focusState = FOCUS_IN;
|
||||
debug( LOG_NEVER, "WM_SETFOCUS\n");
|
||||
if (focusState != FOCUS_IN)
|
||||
{
|
||||
focusState = FOCUS_IN;
|
||||
|
||||
gameTimeStart();
|
||||
// Should be: audio_ResumeAll();
|
||||
gameTimeStart();
|
||||
// Should be: audio_ResumeAll();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debug( LOG_NEVER, "WM_KILLFOCUS\n");
|
||||
if (focusState != FOCUS_OUT)
|
||||
else
|
||||
{
|
||||
focusState = FOCUS_OUT;
|
||||
debug( LOG_NEVER, "WM_KILLFOCUS\n");
|
||||
if (focusState != FOCUS_OUT)
|
||||
{
|
||||
focusState = FOCUS_OUT;
|
||||
|
||||
gameTimeStop();
|
||||
// Should be: audio_PauseAll();
|
||||
audio_StopAll();
|
||||
gameTimeStop();
|
||||
// Should be: audio_PauseAll();
|
||||
audio_StopAll();
|
||||
}
|
||||
/* Have to tell the input system that we've lost focus */
|
||||
inputLooseFocus();
|
||||
}
|
||||
/* Have to tell the input system that we've lost focus */
|
||||
inputLooseFocus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue