#include "fg_fx.hxx"
#include <Main/fg_props.hxx>
+#include <Main/globals.hxx>
#include <simgear/props/props.hxx>
#include <simgear/props/props_io.hxx>
#include <simgear/sound/soundmgr_openal.hxx>
#include <simgear/sound/xmlsound.hxx>
-FGFX::FGFX ( SGSoundMgr *smgr, const std::string &refname, SGPropertyNode *props ) :
+FGFX::FGFX ( const std::string &refname, SGPropertyNode *props ) :
_props( props )
{
if (!props) {
_avionics_ext = _props->getNode("sim/sound/avionics/external-view", true);
_internal = _props->getNode("sim/current-view/internal", true);
+ SGSoundMgr *smgr = globals->get_soundmgr();
+ if (!smgr) {
+ return;
+ }
+
SGSampleGroup::_smgr = smgr;
SGSampleGroup::_refname = refname;
SGSampleGroup::_smgr->add(this, refname);
void
FGFX::init()
{
+ if (!_smgr) {
+ return;
+ }
+
SGPropertyNode *node = _props->getNode("sim/sound", true);
std::string path_str = node->getStringValue("path");
void
FGFX::update (double dt)
{
+ if (!_smgr) {
+ return;
+ }
+
if ( _enabled->getBoolValue() ) {
if ( _avionics_enabled->getBoolValue())
{