Commit dbf44dce authored by Gerhard Stein's avatar Gerhard Stein

Cleanups, fixes

parent 691aeaa7
......@@ -98,7 +98,7 @@ void KeenEngine::ponder(const float deltaT)
return;
if(gMusicPlayer.active() &&
!gMusicPlayer.playing())
gMusicPlayer.paused())
{
gMusicPlayer.play();
}
......
......@@ -172,6 +172,16 @@ void CMusic::play()
{
#if defined(USE_SDLMIXER)
if(Mix_PlayingMusic())
{
Mix_HaltMusic();
}
if(Mix_PausedMusic())
{
Mix_ResumeMusic();
}
// Play music forever
if(Mix_FadeInMusic(mpMixMusic, -1, 2000) == -1)
{
......@@ -194,7 +204,12 @@ void CMusic::play()
void CMusic::pause()
{
#if defined(USE_SDLMIXER)
if(!Mix_PausedMusic())
{
Mix_PauseMusic();
}
#else
if(!mpPlayer)
return;
......@@ -206,7 +221,11 @@ void CMusic::pause()
void CMusic::stop()
{
#if defined(USE_SDLMIXER)
Mix_FadeOutMusic(500);
if(Mix_PlayingMusic())
{
Mix_FadeOutMusic(500);
}
#else
if(!mpPlayer)
......
......@@ -56,6 +56,20 @@ public:
bool LoadfromSonglist(const std::string &gamepath, const int &level);
bool paused()
{
if(!active())
{
return false;
}
#if defined(USE_SDLMIXER)
return Mix_PausedMusic();
#else
return mpPlayer->playing();
#endif
}
bool playing()
{
if(!active())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment