From e6a80d793e0c1772bbe698c187a66cd29bb11d3b Mon Sep 17 00:00:00 2001 From: ehofman Date: Sun, 19 Sep 2004 12:29:07 +0000 Subject: [PATCH] Make use of cached pointers instead of the hash table. --- src/Sound/fg_fx.cxx | 6 ++++-- src/Sound/fg_fx.hxx | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Sound/fg_fx.cxx b/src/Sound/fg_fx.cxx index 4db24d88e..62973b1aa 100644 --- a/src/Sound/fg_fx.cxx +++ b/src/Sound/fg_fx.cxx @@ -40,6 +40,8 @@ FGFX::FGFX () : + _volume( fgGetNode("/sim/sound/volume") ), + _pause( fgGetNode("/sim/sound/pause") ), last_pause( true ), last_volume( 0.0 ) { @@ -108,7 +110,7 @@ void 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(); @@ -118,7 +120,7 @@ FGFX::update (double dt) 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; diff --git a/src/Sound/fg_fx.hxx b/src/Sound/fg_fx.hxx index a5ad0a85b..116b61b55 100644 --- a/src/Sound/fg_fx.hxx +++ b/src/Sound/fg_fx.hxx @@ -56,6 +56,9 @@ private: bool last_pause; double last_volume; + SGPropertyNode *_pause; + SGPropertyNode *_volume; + };