]> git.mxchange.org Git - flightgear.git/blobdiff - src/Canvas/FGCanvasSystemAdapter.cxx
VoiceSynthesizer: add some test/debug properties
[flightgear.git] / src / Canvas / FGCanvasSystemAdapter.cxx
index 0471118dd13ce516088411fa30135f134920ac62..69ea6c5a4b20b1e5f3ae470fc91a6cb0ac9d8dbf 100644 (file)
@@ -20,6 +20,7 @@
 
 #include <Main/globals.hxx>
 #include <Main/util.hxx>
+#include <Network/HTTPClient.hxx>
 #include <Viewer/renderer.hxx>
 
 #include <osgDB/ReadFile>
@@ -71,7 +72,8 @@ namespace canvas
   //----------------------------------------------------------------------------
   void FGCanvasSystemAdapter::removeCamera(osg::Camera* camera) const
   {
-    globals->get_renderer()->removeCamera(camera);
+    if( globals->get_renderer() )
+      globals->get_renderer()->removeCamera(camera);
   }
 
   //----------------------------------------------------------------------------
@@ -97,4 +99,19 @@ namespace canvas
     return 0;
   }
 
+  //----------------------------------------------------------------------------
+  simgear::HTTP::Client* FGCanvasSystemAdapter::getHTTPClient() const
+  {
+    FGHTTPClient* http =
+      static_cast<FGHTTPClient*>(globals->get_subsystem("http"));
+
+    if( http )
+      return http->client();
+
+    SG_LOG( SG_IO,
+            SG_ALERT,
+            "FGCanvasSystemAdapter: Failed to get HTTP subsystem" );
+    return 0;
+  }
+
 }