]> git.mxchange.org Git - flightgear.git/commitdiff
Autopilot mods.
authorcurt <curt>
Tue, 29 Sep 1998 02:03:36 +0000 (02:03 +0000)
committercurt <curt>
Tue, 29 Sep 1998 02:03:36 +0000 (02:03 +0000)
Main/GLUTkey.cxx
Main/GLUTmain.cxx
Main/fg_init.cxx

index 14659f6983c5b45006c5c6a0300e31d8209e82fe..7af29356030e4909f22896128e7ee5ab7d481b2c 100644 (file)
@@ -38,7 +38,7 @@
 #include <Aircraft/aircraft.h>
 #include <Astro/solarsystem.hxx>
 #include <Astro/sky.hxx>
-#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
+#include <Autopilot/autopilot.hxx>
 #include <Cockpit/hud.hxx>
 #include <Debug/fg_debug.h>
 #include <GUI/gui.h>
@@ -88,6 +88,12 @@ void GLUTkey(unsigned char k, int x, int y) {
     if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
        fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
        switch (k) {
+       case 1: // Ctrl-A key
+           fgAPToggleAltitude();
+           return;
+       case 8: // Ctrl-H key
+           fgAPToggleHeading();
+           return;
        case 49: // numeric keypad 1
            v->goal_view_offset = FG_PI * 0.75;
            return;
@@ -151,16 +157,6 @@ void GLUTkey(unsigned char k, int x, int y) {
            tmp /= 1.10;
            fgWeatherSetVisibility( tmp );
            return;
-       // autopilot additions
-       case 65: // A key
-               fgAPSetMode(1);
-               return;
-       case 83: // S key
-               fgAPSetMode(0);
-               return;
-       case 68: // D key
-               fgAPSetHeading(AP_CURRENT_HEADING);
-               return;
        }
     } else {
        fgPrintf( FG_INPUT, FG_DEBUG, "\n");
@@ -200,6 +196,13 @@ void GLUTkey(unsigned char k, int x, int y) {
        case 51: // numeric keypad 3 (Pg Dn)
            fgThrottleMove(0, -0.01);
            return;
+       case 98: // b key
+           int b_ret;
+           double b_set;
+           b_ret = int( fgBrakeGet() );
+           b_set = double(!b_ret);
+           fgBrakeSet(b_set);
+           return;
        case 104: // h key
            HUD_brightkey( false );
            return;
@@ -372,6 +375,9 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 // $Log$
+// Revision 1.25  1998/09/29 02:03:36  curt
+// Autopilot mods.
+//
 // Revision 1.24  1998/09/26 13:16:44  curt
 // C++-ified the comments.
 //
index 68e33eb89bc7f92f902e981ad00e89645ed218b0..c47f4eed8a06ee3314fc5998168d1e99c389cdc6 100644 (file)
@@ -62,6 +62,7 @@
 #  include <Audio/src/sm.h>
 #endif
 
+#include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <Debug/fg_debug.h>
 #include <GUI/gui.h>
@@ -391,6 +392,9 @@ void fgUpdateTimeDepCalcs(int multi_loop) {
     }
 
     if ( !t->pause ) {
+       // run Autopilot system
+       fgAPRun();
+
        // printf("updating flight model x %d\n", multi_loop);
        fgFlightModelUpdate(current_options.get_flight_model(), f, multi_loop);
     } else {
@@ -890,6 +894,9 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.54  1998/09/29 02:03:38  curt
+// Autopilot mods.
+//
 // Revision 1.53  1998/09/26 13:18:35  curt
 // Check if audio "working()" before doing audio manipulations.
 //
index 61589f1a5c1dab82ab349308d4d74e6eeb9d4cc6..bccb25ccf5ddc70768ea6aeebbbd07ee67cd4424 100644 (file)
@@ -50,7 +50,7 @@
 #include <Astro/stars.hxx>
 // #include <Astro/sun.hxx>
 #include <Astro/solarsystem.hxx>
-#include <Autopilot/autopilot.h>
+#include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <Debug/fg_debug.h>
 #include <Joystick/joystick.h>
@@ -398,6 +398,9 @@ int fgInitSubsystems( void )
 
 
 // $Log$
+// Revision 1.39  1998/09/29 02:03:39  curt
+// Autopilot mods.
+//
 // Revision 1.38  1998/09/15 04:27:30  curt
 // Changes for new Astro code.
 //