]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Boris Koenig:
[flightgear.git] / src / Main / main.cxx
index 0085984eae6ea2b69e01d6af4430de9c9c71db31..58c47e0e914e57af5823fb1f7b0f6f3319e43457 100644 (file)
@@ -68,7 +68,7 @@
 #include <Scenery/tilemgr.hxx>
 #include <FDM/flight.hxx>
 #include <FDM/UIUCModel/uiuc_aircraftdir.h>
-#include <FDM/ADA.hxx>
+// #include <FDM/ADA.hxx>
 #include <ATC/ATCdisplay.hxx>
 #include <ATC/ATCmgr.hxx>
 #include <ATC/AIMgr.hxx>
 #include <Environment/environment_mgr.hxx>
 #include <GUI/new_gui.hxx>
 
+#ifdef FG_MPLAYER_AS
+#include <MultiPlayer/multiplaytxmgr.hxx>
+#include <MultiPlayer/multiplayrxmgr.hxx>
+#endif
+
+
 
 #include "fg_commands.hxx"
 #include "fg_io.hxx"
@@ -104,7 +110,6 @@ FGGeneral general;
 int idle_state = 0;
 long global_multi_loop;
 
-
 SGTimeStamp last_time_stamp;
 SGTimeStamp current_time_stamp;
 
@@ -211,7 +216,7 @@ static void fgMainLoop( void ) {
     // static const SGPropertyNode *replay_master
     //     = fgGetNode("/sim/freeze/replay", true);
 
-    SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping",true);
+    SGCloudLayer::enable_bump_mapping = fgGetBool("/sim/rendering/bump-mapping");
 
     // Update the elapsed time.
     static bool first_time = true;
@@ -377,6 +382,11 @@ static void fgMainLoop( void ) {
     if (fgGetBool("/sim/ai-traffic/enabled"))
         globals->get_AI_mgr()->update(delta_time_sec);
 
+#ifdef FG_MPLAYER_AS
+    // Update any multiplayer models
+    globals->get_multiplayer_rx_mgr()->Update();
+#endif
+
     // Run flight model
 
     // Calculate model iterations needed for next frame
@@ -634,7 +644,7 @@ static void fgIdleFunction ( void ) {
 
         SG_LOG( SG_GENERAL, SG_INFO, "Panel visible = " << fgPanelVisible() );
         globals->get_renderer()->resize( fgGetInt("/sim/startup/xsize"),
-               fgGetInt("/sim/startup/ysize") );
+                                         fgGetInt("/sim/startup/ysize") );
 
     } 
 
@@ -711,6 +721,8 @@ bool fgMainInit( int argc, char **argv ) {
         exit(-1);
     }
 
+    sgUseDisplayList = fgGetBool( "/sim/rendering/use-display-list", true );
+
     // Initialize the Aircraft directory to "" (UIUC)
     aircraft_dir = "";
 
@@ -731,9 +743,9 @@ bool fgMainInit( int argc, char **argv ) {
     _bootstrap_OSInit++;
 #endif
 
-    fgRegisterWindowResizeHandler( fgReshape );
+    fgRegisterWindowResizeHandler( FGRenderer::resize );
     fgRegisterIdleHandler( fgIdleFunction );
-    fgRegisterDrawHandler( fgRenderFrame );
+    fgRegisterDrawHandler( FGRenderer::update );
 
 #ifdef FG_ENABLE_MULTIPASS_CLOUDS
     bool get_stencil_buffer = true;
@@ -927,13 +939,8 @@ bool fgMainInit( int argc, char **argv ) {
     // build our custom render states
     globals->get_renderer()->build_states();
 
-    try {
-        // pass control off to the master event handler
-        fgOSMainLoop();
-    } catch (...) {
-        SG_LOG( SG_ALL, SG_ALERT,
-            "Unknown exception in the main loop. Aborting..." );
-    }
+    // pass control off to the master event handler
+    fgOSMainLoop();
 
     // we never actually get here ... but to avoid compiler warnings,
     // etc.