Remove SFX_INITIAL state.
This commit is contained in:
parent
a40d6d8a00
commit
813edc7ddf
@ -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() {}
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user