]> git.mxchange.org Git - flightgear.git/blobdiff - src/Input/FGEventInput.cxx
toggle fullscreen: also adapt GUI plane when resizing
[flightgear.git] / src / Input / FGEventInput.cxx
index 1717cfa1df24d74429eb843f7b64c18dcbb650a7..071323414119e810d657a02d5989371a8eee7206 100644 (file)
 #include <Main/fg_props.hxx>
 #include <simgear/io/sg_file.hxx>
 #include <simgear/props/props_io.hxx>
+#include <simgear/math/SGMath.hxx>
 #include <Scripting/NasalSys.hxx>
 
 using simgear::PropertyList;
 using std::cout;
 using std::endl;
+using std::map;
 
 FGEventSetting::FGEventSetting( SGPropertyNode_ptr base ) :
   value(0.0)
@@ -292,7 +294,7 @@ void FGInputDevice::SetName( string name )
 const char * FGEventInput::PROPERTY_ROOT = "/input/event";
 
 FGEventInput::FGEventInput() : 
-  configMap( "Input/Event", fgGetNode( PROPERTY_ROOT, true ), "device-named" )
+  configMap( "Input/Event", fgGetNode(PROPERTY_ROOT, true), "device-named")
 {
 }
 
@@ -327,7 +329,7 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice )
   SGPropertyNode_ptr deviceNode = NULL;
 
   // look for configuration in the device map
-  if( configMap.count( inputDevice->GetName() ) > 0 ) {
+  if ( configMap.hasConfiguration( inputDevice->GetName() ) ) {
     // found - copy to /input/event/device[n]
 
     // find a free index
@@ -345,7 +347,7 @@ unsigned FGEventInput::AddDevice( FGInputDevice * inputDevice )
     deviceNode = baseNode->getNode( "device", index, true );
 
     // and copy the properties from the configuration tree
-    copyProperties( configMap[ inputDevice->GetName() ], deviceNode );
+    copyProperties( configMap.configurationForDeviceName(inputDevice->GetName()), deviceNode );
 
   }