This commit is contained in:
Charles 2001-07-13 13:49:58 +00:00
parent dc4fa7f1a6
commit 019855dba0
2 changed files with 27 additions and 1 deletions

View File

@ -21,7 +21,18 @@ void CFXGeyser::init(DVECTOR const &_Pos)
CFX::init(_Pos);
Height=TargetHeight=8;
currentFrame=FRM__GUSH000;
/* m_soundId=*/CSoundMediator::playSfx(CSoundMediator::SFX_WORLD_OBJECT__GEYSER,false);
SoundId = NOT_PLAYING;
}
/*****************************************************************************/
void CFXGeyser::shutdown()
{
if ( SoundId != NOT_PLAYING )
{
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) SoundId );
}
CFX::shutdown();
}
/*****************************************************************************/
@ -50,6 +61,14 @@ CThing *Parent=getParent();
getFXRenderPos(RenderPos);
if (!canRender() || Flags & FX_FLAG_HIDDEN) return;
if( SoundId != NOT_PLAYING && !CSoundMediator::isSfxStillPlaying( (xmPlayingId) SoundId ) )
{
// unlock sound if it has finished
CSoundMediator::stopAndUnlockSfx( (xmPlayingId) SoundId );
SoundId = NOT_PLAYING;
}
// is it attached to a platform?
if (Parent)
{ // yes, so get pos, and return
@ -63,6 +82,11 @@ CThing *Parent=getParent();
if ( Height > 10 )
{
Flags |= FX_FLAG_INJURE_PLAYER;
if ( SoundId == NOT_PLAYING )
{
SoundId = (int) CSoundMediator::playSfx(CSoundMediator::SFX_WORLD_OBJECT__GEYSER,true);
}
}
else
{

View File

@ -15,12 +15,14 @@ public:
/*virtual */void init(DVECTOR const &Pos);
/*virtual */void think(int Frames);
/*virtual */void render();
void shutdown();
void setHeight(int H) {TargetHeight=H;}
protected:
s16 TargetHeight,Height;
u16 currentFrame;
int SoundId;
};
#endif