]> git.mxchange.org Git - flightgear.git/blobdiff - src/Network/jpg-httpd.cxx
Merge branch 'next' into durk-atc
[flightgear.git] / src / Network / jpg-httpd.cxx
index 0cc9ee29fd466737be4f03073090c0981659c1cd..55e5e79c02c44619fddf7c50dfcebda0f9abfe50 100644 (file)
@@ -31,9 +31,9 @@
 
 #include <simgear/compiler.h>
 
-#include <stdlib.h>            // atoi() atof()
+#include <cstdlib>             // atoi() atof()
 
-#include STL_STRING
+#include <cstring>
 
 #include <simgear/debug/logstream.hxx>
 #include <simgear/io/iochannel.hxx>
 
 #include <Main/fg_props.hxx>
 #include <Main/globals.hxx>
+#include <Main/renderer.hxx>
 
 #include "jpg-httpd.hxx"
 
-//[Leidson<]
 #define __MAX_HTTP_BLOCK_SIZE       4096
 #define __MAX_STRING_SIZE           2048
 #define __TIMEOUT_COUNT             5
 #define __HTTP_GET_STRING           "GET "
-//[Leidson>]
 
+#include <osgUtil/SceneView>
+#include <osgViewer/Viewer>
+extern osg::ref_ptr<osgUtil::SceneView> sceneView;
 
-SG_USING_STD(string);
+using std::string;
 
 
 bool FGJpegHttpd::open() {
@@ -73,7 +75,7 @@ bool FGJpegHttpd::open() {
 
 
 bool FGJpegHttpd::process() {
-    netChannel::poll();
+    simgear::NetChannel::poll();
 
     return true;
 }
@@ -105,6 +107,13 @@ void HttpdImageChannel :: foundTerminator( void ) {
         
         SG_LOG( SG_IO, SG_DEBUG, "<<<<<<<<< HTTP Request : " << pRequest );
 
+        double left, right, bottom, top, zNear, zFar;
+       osgViewer::Viewer* viewer = globals->get_renderer()->getViewer();
+        viewer->getCamera()->getProjectionMatrixAsFrustum(left, right,
+                                                          bottom, top,
+                                                          zNear, zFar);
+        JpgFactory->setFrustum( left, right, bottom, top, zNear, zFar );
+
         nImageLen  = JpgFactory -> render();
        nBlockSize = ( nImageLen < __MAX_HTTP_BLOCK_SIZE ? nImageLen : __MAX_HTTP_BLOCK_SIZE );