This commit is contained in:
Charles 2001-06-18 19:06:43 +00:00
parent bd6fd54608
commit 16c576b885
34 changed files with 288 additions and 49 deletions

View file

@ -607,6 +607,8 @@ void CNpcPlatform::init()
m_npcPath.initPath();
m_speed = m_dataPtr->speed;
m_soundId = (int) NOT_PLAYING;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -682,6 +684,11 @@ void CNpcPlatform::postInit()
void CNpcPlatform::shutdown()
{
if ( m_soundId != NOT_PLAYING )
{
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId );
}
delete m_modelGfx;
//m_npcPath.removeAllWaypoints();
@ -691,6 +698,17 @@ void CNpcPlatform::shutdown()
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPlatform::leftThinkZone(int _frames)
{
if ( m_soundId != NOT_PLAYING )
{
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId );
m_soundId = NOT_PLAYING;
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcPlatform::processLifetime( int _frames )
{
switch( m_lifetimeType )
@ -747,6 +765,16 @@ void CNpcPlatform::processLifetime( int _frames )
void CNpcPlatform::think(int _frames)
{
if ( m_soundId != NOT_PLAYING )
{
if( !CSoundMediator::isSfxStillPlaying( (xmPlayingId) m_soundId ) )
{
// unlock sound if it has finished
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) m_soundId );
m_soundId = NOT_PLAYING;
}
}
if ( m_isActive )
{