]> git.mxchange.org Git - flightgear.git/blobdiff - Main/GLUTmain.cxx
C++-ifying.
[flightgear.git] / Main / GLUTmain.cxx
index 68e33eb89bc7f92f902e981ad00e89645ed218b0..ee157faffde093a5fec25e8967becc56350c28d1 100644 (file)
@@ -1,10 +1,8 @@
-
-//
 // GLUTmain.cxx -- top level sim routines
 //
 // Written by Curtis Olson for OpenGL, started May 1997.
 //
-// Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
+// Copyright (C) 1997  Curtis L. Olson  - curt@me.umn.edu
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 #  include <Audio/src/sm.h>
 #endif
 
+#include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <Debug/fg_debug.h>
 #include <GUI/gui.h>
 #include <Joystick/joystick.h>
-#include <Math/fg_geodesy.h>
+#include <Math/fg_geodesy.hxx>
 #include <Math/mat3.h>
 #include <Math/polar3d.hxx>
 #include <PUI/pu.h>
@@ -301,7 +300,7 @@ static void fgRenderFrame( void ) {
        // setup transformation for drawing astronomical objects
        xglPushMatrix();
        // Translate to view position
-       xglTranslatef( v->view_pos.x, v->view_pos.y, v->view_pos.z );
+       xglTranslatef( v->view_pos.x(), v->view_pos.y(), v->view_pos.z() );
        // Rotate based on gst (sidereal time)
        // note: constant should be 15.041085, Curt thought it was 15
        angle = t->gst * 15.041085;
@@ -391,6 +390,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 {
@@ -473,6 +475,8 @@ static void fgMainLoop( void ) {
     fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
     fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
 
+    fgWeatherUpdate();
+
     // Fix elevation.  I'm just sticking this here for now, it should
     // probably move eventually
 
@@ -572,7 +576,7 @@ static void fgMainLoop( void ) {
 
     // Run audio scheduler
 #ifdef ENABLE_AUDIO_SUPPORT
-    if ( current_options.get_sound() && !audio_sched->not_working() ) {
+    if ( current_options.get_sound() && audio_sched->working() ) {
        double param = c->throttle[0] * 2.0 + 1.0;
 
        pitch_envelope.setStep  ( 0, 0.01, param );
@@ -694,7 +698,7 @@ static void fgIdleFunction ( void ) {
               s1 -> getRate(), s1 -> getBps(), s1 -> getStereo());
        audio_sched -> loopSample ( s1 );
 
-       if ( !audio_sched->not_working() ) {
+       if ( audio_sched->working() ) {
            pitch_envelope.setStep  ( 0, 0.01, 0.6 );
            volume_envelope.setStep ( 0, 0.01, 0.6 );
 
@@ -890,6 +894,21 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.58  1998/10/16 23:27:52  curt
+// C++-ifying.
+//
+// Revision 1.57  1998/10/16 00:54:00  curt
+// Converted to Point3D class.
+//
+// Revision 1.56  1998/10/02 12:46:47  curt
+// Added an "auto throttle"
+//
+// Revision 1.55  1998/09/29 14:58:18  curt
+// Use working() instead of !not_working() for audio.
+//
+// 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.
 //