Pass current-dir into XMLSound
(and update to revised SGSoundSample ctor)
This commit is contained in:
parent
a7a2cb393a
commit
8330449c5f
4 changed files with 5 additions and 8 deletions
|
@ -66,7 +66,7 @@ void FGClouds::set_update_event(int count) {
|
||||||
|
|
||||||
void FGClouds::init(void) {
|
void FGClouds::init(void) {
|
||||||
if( snd_lightning == NULL ) {
|
if( snd_lightning == NULL ) {
|
||||||
snd_lightning = new SGSoundSample(globals->get_fg_root().c_str(), "Sounds/thunder.wav");
|
snd_lightning = new SGSoundSample("Sounds/thunder.wav", SGPath());
|
||||||
snd_lightning->set_max_dist(7000.0f);
|
snd_lightning->set_max_dist(7000.0f);
|
||||||
snd_lightning->set_reference_dist(3000.0f);
|
snd_lightning->set_reference_dist(3000.0f);
|
||||||
SGSoundMgr *smgr = globals->get_soundmgr();
|
SGSoundMgr *smgr = globals->get_soundmgr();
|
||||||
|
|
|
@ -2272,13 +2272,10 @@ MK_VIII::VoicePlayer::get_sample (const char *name)
|
||||||
SGSoundSample *sample = _sgr->find(refname.str());
|
SGSoundSample *sample = _sgr->find(refname.str());
|
||||||
if (! sample)
|
if (! sample)
|
||||||
{
|
{
|
||||||
SGPath sample_path(globals->get_fg_root());
|
string filename = "Sounds/mk-viii" + string(name) + ".wav";
|
||||||
sample_path.append("Sounds/mk-viii");
|
|
||||||
|
|
||||||
string filename = string(name) + ".wav";
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
sample = new SGSoundSample(sample_path.c_str(), filename.c_str());
|
sample = new SGSoundSample(filename.c_str(), SGPath());
|
||||||
}
|
}
|
||||||
catch (const sg_exception &e)
|
catch (const sg_exception &e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1211,7 +1211,7 @@ do_play_audio_sample (const SGPropertyNode * arg)
|
||||||
queue->tie_to_listener();
|
queue->tie_to_listener();
|
||||||
}
|
}
|
||||||
|
|
||||||
SGSoundSample *msg = new SGSoundSample(path.c_str(), file.c_str());
|
SGSoundSample *msg = new SGSoundSample(file.c_str(), path);
|
||||||
msg->set_volume( volume );
|
msg->set_volume( volume );
|
||||||
queue->add( msg );
|
queue->add( msg );
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ FGFX::init()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
sound->init(globals->get_props(), node->getChild(i), this,
|
sound->init(globals->get_props(), node->getChild(i), this,
|
||||||
_avionics, globals->get_fg_root());
|
_avionics, path.dir());
|
||||||
|
|
||||||
_sound.push_back(sound);
|
_sound.push_back(sound);
|
||||||
} catch ( sg_exception &e ) {
|
} catch ( sg_exception &e ) {
|
||||||
|
|
Loading…
Reference in a new issue