Remove SFX_INITIAL state.

This commit is contained in:
hiker 2014-10-17 12:00:00 +11:00
parent a40d6d8a00
commit 813edc7ddf
3 changed files with 5 additions and 5 deletions

View File

@ -45,8 +45,7 @@ public:
/** Status of a sound effect. */
enum SFXStatus
{
SFX_UNKNOWN = -1, SFX_STOPPED = 0, SFX_PAUSED = 1, SFX_PLAYING = 2,
SFX_INITIAL = 3
SFX_UNKNOWN = -1, SFX_STOPPED = 0, SFX_PAUSED = 1, SFX_PLAYING = 2
};
virtual ~SFXBase() {}

View File

@ -312,8 +312,10 @@ void SFXOpenAL::deleteSFX()
void SFXOpenAL::play()
{
// Technically the sfx is only playing after the sfx thread starts it,
// but for STK this is correct since we don't want to start the same
// sfx twice.
// but this is important to set this here since stk might decide the
// delete a sfx if it has finished playing (i.e. is in stopped state)
// - which can happen if the sfx thread had no time to actually start
// it yet.
m_status = SFX_PLAYING;
SFXManager::get()->queue(SFXManager::SFX_PLAY, this);
} // play

View File

@ -65,6 +65,5 @@ void HitSFX::setPlayerKartHit()
bool HitSFX::updateAndDelete(float dt)
{
SFXBase::SFXStatus status = m_sfx->getStatus();
if(status==SFXBase::SFX_INITIAL) return false;
return status!= SFXBase::SFX_PLAYING;
} // updateAndDelete