Add rain sound
This commit is contained in:
parent
5a937d6f12
commit
61d70ea599
@ -48,6 +48,14 @@ Rain::Rain(Camera *camera, irr::scene::ISceneNode* parent) : m_thunder_sound(0)
|
||||
|
||||
if (m_lightning)
|
||||
m_thunder_sound = sfx_manager->createSoundSource("thunder");
|
||||
|
||||
m_rain_sound = sfx_manager->createSoundSource("rain");
|
||||
|
||||
if (m_rain_sound)
|
||||
{
|
||||
m_rain_sound->setLoop(true);
|
||||
m_rain_sound->play();
|
||||
}
|
||||
|
||||
Material* m = material_manager->getMaterial("rain.png");
|
||||
assert(m != NULL);
|
||||
@ -67,7 +75,11 @@ Rain::~Rain()
|
||||
// m_node->drop(); // drop STK's reference
|
||||
// m_node->remove(); // Then remove it from the scene graph.
|
||||
|
||||
if (m_lightning && m_thunder_sound != NULL) sfx_manager->deleteSFX(m_thunder_sound);
|
||||
if (m_lightning && m_thunder_sound != NULL)
|
||||
sfx_manager->deleteSFX(m_thunder_sound);
|
||||
|
||||
if (m_rain_sound != NULL)
|
||||
sfx_manager->deleteSFX(m_rain_sound);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@ -39,6 +39,7 @@ class Rain
|
||||
float m_next_lightning;
|
||||
bool m_lightning;
|
||||
SFXBase* m_thunder_sound;
|
||||
SFXBase* m_rain_sound;
|
||||
|
||||
public:
|
||||
Rain(Camera* camera, irr::scene::ISceneNode* parent);
|
||||
|
Loading…
x
Reference in New Issue
Block a user