This commit is contained in:
Charles 2001-07-19 16:43:48 +00:00
parent 017b5df9a9
commit 8f6b538674
5 changed files with 15 additions and 50 deletions

View File

@ -431,7 +431,7 @@ void CFX::killFX()
}
if (EndSnd)
{
CSoundMediator::playSfx( (CSoundMediator::SFXID)EndSnd,false);
CSoundMediator::playSfx( (CSoundMediator::SFXID)EndSnd,false,true);
}
}

View File

@ -44,9 +44,20 @@ void CFXBaseAnim::think(int _frames)
MaxFrame=((BaseData->EndFrame-BaseData->StartFrame)<<BaseData->FrameShift)-1;
Flags|=BaseData->Flags;
renderFrame=BaseData->StartFrame;
if (BaseData->StartSnd)
if(m_soundId==NOT_PLAYING)
{
CSoundMediator::playSfx((CSoundMediator::SFXID)BaseData->StartSnd,false);
if (BaseData->StartSnd)
{
m_soundId=CSoundMediator::playSfx((CSoundMediator::SFXID)BaseData->StartSnd,true,true);
}
}
else
{
if(!CSoundMediator::isSfxStillPlaying(m_soundId))
{
CSoundMediator::stopAndUnlockSfx(m_soundId);
m_soundId=NOT_PLAYING;
}
}
EndSnd=BaseData->EndSnd;
HasInit=true;

View File

@ -119,7 +119,7 @@ int TotalLife=0;
if(m_soundId==NOT_PLAYING)
{
m_soundId=CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__STEAM,true);
m_soundId=CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__STEAM,true,true);
}
else
{

View File

@ -22,49 +22,6 @@
#include "fx\fxsteam.h"
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CSteamEmitterTrigger::init()
{
CTrigger::init();
m_soundId = (int) NOT_PLAYING;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CSteamEmitterTrigger::think(int _frames)
{
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_HAZARD__STEAM, true );
}
else
{
if( !CSoundMediator::isSfxStillPlaying( (xmPlayingId) m_soundId ) )
{
// unlock sound if it has finished
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId );
m_soundId = NOT_PLAYING;
}
}
CTrigger::think( _frames );
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CSteamEmitterTrigger::shutdown()
{
if ( m_soundId != NOT_PLAYING )
{
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId );
}
CTrigger::shutdown();
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CSteamEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h)

View File

@ -43,9 +43,6 @@
class CSteamEmitterTrigger : public CTrigger
{
public:
void init();
void think(int _frames);
void shutdown();
virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
protected:
CFX *m_effect;