1
0
forked from 0ad/0ad

fix build when using --without-audio

This was SVN commit r13389.
This commit is contained in:
stwf 2013-05-02 13:58:28 +00:00
parent 683f22cdb1
commit bf959e1c46
3 changed files with 11 additions and 0 deletions

View File

@ -72,14 +72,18 @@ InReaction GlobalsInputHandler(const SDL_Event_* ev)
if(ev->ev.active.state & SDL_APPACTIVE)
{
g_app_minimized = (ev->ev.active.gain == 0); // negated
#if CONFIG2_AUDIO
if ( g_SoundManager )
g_SoundManager->Pause( g_app_minimized && g_PauseOnFocusLoss && !g_NetClient );
#endif
}
if(ev->ev.active.state & SDL_APPINPUTFOCUS)
{
g_app_has_focus = (ev->ev.active.gain != 0);
#if CONFIG2_AUDIO
if ( g_SoundManager )
g_SoundManager->Pause( !g_app_has_focus && g_PauseOnFocusLoss && !g_NetClient );
#endif
}
if(ev->ev.active.state & SDL_APPMOUSEFOCUS)
g_mouse_active = (ev->ev.active.gain != 0);

View File

@ -341,8 +341,10 @@ JSBool SetPaused(JSContext* cx, uintN argc, jsval* vp)
try
{
g_Game->m_Paused = ToPrimitive<bool> (JS_ARGV(cx, vp)[0]);
#if CONFIG2_AUDIO
if ( g_SoundManager )
g_SoundManager->Pause(g_Game->m_Paused);
#endif
}
catch (PSERROR_Scripting_ConversionFailed)
{

View File

@ -33,7 +33,9 @@
JMusicList::JMusicList()
{
#if CONFIG2_AUDIO
g_SoundManager->ClearPlayListItems();
#endif
}
bool JMusicList::AddItem(JSContext* cx, uintN UNUSED(argc), jsval* vp)
@ -42,7 +44,10 @@ bool JMusicList::AddItem(JSContext* cx, uintN UNUSED(argc), jsval* vp)
if (! ToPrimitive<CStrW>(cx, vp[0], filename))
return false;
#if CONFIG2_AUDIO
g_SoundManager->AddPlayListItem( new VfsPath( filename ) );
#endif
return true;
}