Make use of cached pointers instead of the hash table.
This commit is contained in:
parent
55270d13fd
commit
e6a80d793e
2 changed files with 7 additions and 2 deletions
|
@ -40,6 +40,8 @@
|
||||||
|
|
||||||
|
|
||||||
FGFX::FGFX () :
|
FGFX::FGFX () :
|
||||||
|
_volume( fgGetNode("/sim/sound/volume") ),
|
||||||
|
_pause( fgGetNode("/sim/sound/pause") ),
|
||||||
last_pause( true ),
|
last_pause( true ),
|
||||||
last_volume( 0.0 )
|
last_volume( 0.0 )
|
||||||
{
|
{
|
||||||
|
@ -108,7 +110,7 @@ void
|
||||||
FGFX::update (double dt)
|
FGFX::update (double dt)
|
||||||
{
|
{
|
||||||
// command sound manger
|
// command sound manger
|
||||||
bool pause = fgGetBool("/sim/sound/pause");
|
bool pause = _pause->getBoolValue();
|
||||||
if ( pause != last_pause ) {
|
if ( pause != last_pause ) {
|
||||||
if ( pause ) {
|
if ( pause ) {
|
||||||
globals->get_soundmgr()->pause();
|
globals->get_soundmgr()->pause();
|
||||||
|
@ -118,7 +120,7 @@ FGFX::update (double dt)
|
||||||
last_pause = pause;
|
last_pause = pause;
|
||||||
}
|
}
|
||||||
|
|
||||||
double volume = fgGetDouble("/sim/sound/volume");
|
double volume = _volume->getDoubleValue();
|
||||||
if ( volume != last_volume ) {
|
if ( volume != last_volume ) {
|
||||||
globals->get_soundmgr()->set_volume( volume );
|
globals->get_soundmgr()->set_volume( volume );
|
||||||
last_volume = volume;
|
last_volume = volume;
|
||||||
|
|
|
@ -56,6 +56,9 @@ private:
|
||||||
bool last_pause;
|
bool last_pause;
|
||||||
double last_volume;
|
double last_volume;
|
||||||
|
|
||||||
|
SGPropertyNode *_pause;
|
||||||
|
SGPropertyNode *_volume;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue