1
0
Fork 0

Autopilot mods.

This commit is contained in:
curt 1998-09-29 02:03:36 +00:00
parent 1bafaa31f6
commit a09d8f2d62
3 changed files with 28 additions and 12 deletions

View file

@ -38,7 +38,7 @@
#include <Aircraft/aircraft.h> #include <Aircraft/aircraft.h>
#include <Astro/solarsystem.hxx> #include <Astro/solarsystem.hxx>
#include <Astro/sky.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 <Cockpit/hud.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <GUI/gui.h> #include <GUI/gui.h>
@ -88,6 +88,12 @@ void GLUTkey(unsigned char k, int x, int y) {
if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) { if ( GLUT_ACTIVE_ALT && glutGetModifiers() ) {
fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n"); fgPrintf( FG_INPUT, FG_DEBUG, " SHIFTED\n");
switch (k) { switch (k) {
case 1: // Ctrl-A key
fgAPToggleAltitude();
return;
case 8: // Ctrl-H key
fgAPToggleHeading();
return;
case 49: // numeric keypad 1 case 49: // numeric keypad 1
v->goal_view_offset = FG_PI * 0.75; v->goal_view_offset = FG_PI * 0.75;
return; return;
@ -151,16 +157,6 @@ void GLUTkey(unsigned char k, int x, int y) {
tmp /= 1.10; tmp /= 1.10;
fgWeatherSetVisibility( tmp ); fgWeatherSetVisibility( tmp );
return; 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 { } else {
fgPrintf( FG_INPUT, FG_DEBUG, "\n"); 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) case 51: // numeric keypad 3 (Pg Dn)
fgThrottleMove(0, -0.01); fgThrottleMove(0, -0.01);
return; 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 case 104: // h key
HUD_brightkey( false ); HUD_brightkey( false );
return; return;
@ -372,6 +375,9 @@ void GLUTspecialkey(int k, int x, int y) {
// $Log$ // $Log$
// Revision 1.25 1998/09/29 02:03:36 curt
// Autopilot mods.
//
// Revision 1.24 1998/09/26 13:16:44 curt // Revision 1.24 1998/09/26 13:16:44 curt
// C++-ified the comments. // C++-ified the comments.
// //

View file

@ -62,6 +62,7 @@
# include <Audio/src/sm.h> # include <Audio/src/sm.h>
#endif #endif
#include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <GUI/gui.h> #include <GUI/gui.h>
@ -391,6 +392,9 @@ void fgUpdateTimeDepCalcs(int multi_loop) {
} }
if ( !t->pause ) { if ( !t->pause ) {
// run Autopilot system
fgAPRun();
// printf("updating flight model x %d\n", multi_loop); // printf("updating flight model x %d\n", multi_loop);
fgFlightModelUpdate(current_options.get_flight_model(), f, multi_loop); fgFlightModelUpdate(current_options.get_flight_model(), f, multi_loop);
} else { } else {
@ -890,6 +894,9 @@ int main( int argc, char **argv ) {
// $Log$ // $Log$
// Revision 1.54 1998/09/29 02:03:38 curt
// Autopilot mods.
//
// Revision 1.53 1998/09/26 13:18:35 curt // Revision 1.53 1998/09/26 13:18:35 curt
// Check if audio "working()" before doing audio manipulations. // Check if audio "working()" before doing audio manipulations.
// //

View file

@ -50,7 +50,7 @@
#include <Astro/stars.hxx> #include <Astro/stars.hxx>
// #include <Astro/sun.hxx> // #include <Astro/sun.hxx>
#include <Astro/solarsystem.hxx> #include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.h> #include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h> #include <Debug/fg_debug.h>
#include <Joystick/joystick.h> #include <Joystick/joystick.h>
@ -398,6 +398,9 @@ int fgInitSubsystems( void )
// $Log$ // $Log$
// Revision 1.39 1998/09/29 02:03:39 curt
// Autopilot mods.
//
// Revision 1.38 1998/09/15 04:27:30 curt // Revision 1.38 1998/09/15 04:27:30 curt
// Changes for new Astro code. // Changes for new Astro code.
// //