]> git.mxchange.org Git - flightgear.git/commitdiff
Make use of cached pointers instead of the hash table.
authorehofman <ehofman>
Sun, 19 Sep 2004 12:29:07 +0000 (12:29 +0000)
committerehofman <ehofman>
Sun, 19 Sep 2004 12:29:07 +0000 (12:29 +0000)
src/Sound/fg_fx.cxx
src/Sound/fg_fx.hxx

index 4db24d88ed7722e594ec0e4ae3d7637d49ee16ab..62973b1aa967a1a6275a63b7be04175940124dad 100644 (file)
@@ -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;
index a5ad0a85b607ffe00a54ae4d4443220c19ee403d..116b61b550cce10c3892e9c8beddc680bac86b5f 100644 (file)
@@ -56,6 +56,9 @@ private:
   bool last_pause;
   double last_volume;
 
+  SGPropertyNode *_pause;
+  SGPropertyNode *_volume;
+
 };