// Started by David Megginson, October 2001
// (Reuses some code from main.cxx, probably by Curtis Olson)
//
-// Copyright (C) 2001 Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2001 Curtis L. Olson - http://www.flightgear.org/~curt
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
FGFX::FGFX () :
+ _volume( fgGetNode("/sim/sound/volume") ),
+ _pause( fgGetNode("/sim/sound/pause") ),
last_pause( true ),
last_volume( 0.0 )
{
FGFX::update (double dt)
{
// command sound manger
- bool pause = fgGetBool("/sim/sound/pause");
+ bool pause = _pause->getBoolValue();
if ( pause != last_pause ) {
if ( pause ) {
globals->get_soundmgr()->pause();
last_pause = pause;
}
- double volume = fgGetDouble("/sim/sound/volume");
+ double volume = _volume->getDoubleValue();
if ( volume != last_volume ) {
globals->get_soundmgr()->set_volume( volume );
last_volume = volume;