This commit is contained in:
parent
dc4fa7f1a6
commit
019855dba0
2 changed files with 27 additions and 1 deletions
|
@ -21,7 +21,18 @@ void CFXGeyser::init(DVECTOR const &_Pos)
|
||||||
CFX::init(_Pos);
|
CFX::init(_Pos);
|
||||||
Height=TargetHeight=8;
|
Height=TargetHeight=8;
|
||||||
currentFrame=FRM__GUSH000;
|
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);
|
getFXRenderPos(RenderPos);
|
||||||
if (!canRender() || Flags & FX_FLAG_HIDDEN) return;
|
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?
|
// is it attached to a platform?
|
||||||
if (Parent)
|
if (Parent)
|
||||||
{ // yes, so get pos, and return
|
{ // yes, so get pos, and return
|
||||||
|
@ -63,6 +82,11 @@ CThing *Parent=getParent();
|
||||||
if ( Height > 10 )
|
if ( Height > 10 )
|
||||||
{
|
{
|
||||||
Flags |= FX_FLAG_INJURE_PLAYER;
|
Flags |= FX_FLAG_INJURE_PLAYER;
|
||||||
|
|
||||||
|
if ( SoundId == NOT_PLAYING )
|
||||||
|
{
|
||||||
|
SoundId = (int) CSoundMediator::playSfx(CSoundMediator::SFX_WORLD_OBJECT__GEYSER,true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,12 +15,14 @@ public:
|
||||||
/*virtual */void init(DVECTOR const &Pos);
|
/*virtual */void init(DVECTOR const &Pos);
|
||||||
/*virtual */void think(int Frames);
|
/*virtual */void think(int Frames);
|
||||||
/*virtual */void render();
|
/*virtual */void render();
|
||||||
|
void shutdown();
|
||||||
|
|
||||||
void setHeight(int H) {TargetHeight=H;}
|
void setHeight(int H) {TargetHeight=H;}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
s16 TargetHeight,Height;
|
s16 TargetHeight,Height;
|
||||||
u16 currentFrame;
|
u16 currentFrame;
|
||||||
|
int SoundId;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue