]> git.mxchange.org Git - flightgear.git/blobdiff - src/Cockpit/cockpit.cxx
Fix Carriers without catapults and wires.
[flightgear.git] / src / Cockpit / cockpit.cxx
index fe3f9f3931f8be9eb1b32cb30d2d6d1a328833da..4e7651f7ce75b21f57bd6a28bee063a2839b137d 100644 (file)
 #  include <config.h>
 #endif
 
-#ifdef HAVE_WINDOWS_H
-#  include <windows.h>
-#endif
-
 #include <simgear/compiler.h>
 
-#include SG_GLU_H
-
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
 
 #include <simgear/constants.h>
 #include <simgear/debug/logstream.hxx>
-#include <simgear/math/polar3d.hxx>
 #include <simgear/props/props.hxx>
 #include <simgear/timing/sg_time.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Include/general.hxx>
-#ifdef ENABLE_SP_FMDS
+#ifdef ENABLE_SP_FDM
 #include <FDM/SP/ADA.hxx>
 #endif
 #include <Main/globals.hxx>
 #include <Main/fg_props.hxx>
 #include <Main/viewmgr.hxx>
 #include <Scenery/scenery.hxx>
-#include <Time/fg_timer.hxx>
 #include <GUI/gui.h>
 
 #include "cockpit.hxx"
 #include "hud.hxx"
 
 
-// This is a structure that contains all data related to
-// cockpit/panel/hud system
-
-static pCockpit ac_cockpit;
 // The following routines obtain information concerntin the aircraft's
 // current state and return it to calling instrument display routines.
 // They should eventually be member functions of the aircraft.
@@ -341,7 +329,7 @@ float get_anzg   ( void )
     return anzg;
 }
 
-#ifdef ENABLE_SP_FMDS
+#ifdef ENABLE_SP_FDM
 int get_iaux1 (void)
 {
     FGADA *fdm = (FGADA *)current_aircraft.fdm_state;
@@ -541,20 +529,11 @@ bool fgCockpitInit( fgAIRCRAFT *cur_aircraft )
     // current aircraft.
 
     fgHUDInit( cur_aircraft );
-    ac_cockpit = new fg_Cockpit();
-
-    SG_LOG( SG_COCKPIT, SG_INFO,
-        "  Code " << ac_cockpit->code() << " Status "
-        << ac_cockpit->status() );
 
     return true;
 }
 
-void fgCockpitUpdate( void ) {
-
-    SG_LOG( SG_COCKPIT, SG_DEBUG,
-            "Cockpit: code " << ac_cockpit->code() << " status "
-            << ac_cockpit->status() );
+void fgCockpitUpdate( osg::State* state ) {
 
     static const SGPropertyNode * xsize_node = fgGetNode("/sim/startup/xsize");
     static const SGPropertyNode * ysize_node = fgGetNode("/sim/startup/ysize");
@@ -568,7 +547,7 @@ void fgCockpitUpdate( void ) {
     if ( hud_visibility_node->getBoolValue() ) {
         // This will check the global hud linked list pointer.
         // If there is anything to draw it will.
-        fgUpdateHUD();
+        fgUpdateHUD( state );
     }
 
     glViewport( 0, 0, iwidth, iheight );
@@ -579,7 +558,7 @@ void fgCockpitUpdate( void ) {
 
 
 struct FuncTable {
-    char *name;
+    const char *name;
     FLTFNPTR func;
 } fn_table[] = {
     { "agl", get_agl },
@@ -603,7 +582,7 @@ struct FuncTable {
     { "view_direction", get_view_direction },
     { "vfc_tris_culled", get_vfc_tris_culled },
     { "vfc_tris_drawn", get_vfc_tris_drawn },
-#ifdef ENABLE_SP_FMDS
+#ifdef ENABLE_SP_FDM
     { "aux1", get_aux1 },
     { "aux2", get_aux2 },
     { "aux3", get_aux3 },