This commit is contained in:
parent
017b5df9a9
commit
8f6b538674
5 changed files with 15 additions and 50 deletions
|
@ -431,7 +431,7 @@ void CFX::killFX()
|
||||||
}
|
}
|
||||||
if (EndSnd)
|
if (EndSnd)
|
||||||
{
|
{
|
||||||
CSoundMediator::playSfx( (CSoundMediator::SFXID)EndSnd,false);
|
CSoundMediator::playSfx( (CSoundMediator::SFXID)EndSnd,false,true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,20 @@ void CFXBaseAnim::think(int _frames)
|
||||||
MaxFrame=((BaseData->EndFrame-BaseData->StartFrame)<<BaseData->FrameShift)-1;
|
MaxFrame=((BaseData->EndFrame-BaseData->StartFrame)<<BaseData->FrameShift)-1;
|
||||||
Flags|=BaseData->Flags;
|
Flags|=BaseData->Flags;
|
||||||
renderFrame=BaseData->StartFrame;
|
renderFrame=BaseData->StartFrame;
|
||||||
|
if(m_soundId==NOT_PLAYING)
|
||||||
|
{
|
||||||
if (BaseData->StartSnd)
|
if (BaseData->StartSnd)
|
||||||
{
|
{
|
||||||
CSoundMediator::playSfx((CSoundMediator::SFXID)BaseData->StartSnd,false);
|
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;
|
EndSnd=BaseData->EndSnd;
|
||||||
HasInit=true;
|
HasInit=true;
|
||||||
|
|
|
@ -119,7 +119,7 @@ int TotalLife=0;
|
||||||
|
|
||||||
if(m_soundId==NOT_PLAYING)
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,49 +22,6 @@
|
||||||
#include "fx\fxsteam.h"
|
#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)
|
void CSteamEmitterTrigger::setPositionAndSize(int _x,int _y,int _w,int _h)
|
||||||
|
|
|
@ -43,9 +43,6 @@
|
||||||
class CSteamEmitterTrigger : public CTrigger
|
class CSteamEmitterTrigger : public CTrigger
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void init();
|
|
||||||
void think(int _frames);
|
|
||||||
void shutdown();
|
|
||||||
virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
|
virtual void setPositionAndSize(int _x,int _y,int _w,int _h);
|
||||||
protected:
|
protected:
|
||||||
CFX *m_effect;
|
CFX *m_effect;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue