]> git.mxchange.org Git - flightgear.git/blobdiff - Main/GLUTmain.c
Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
[flightgear.git] / Main / GLUTmain.c
index 0a94cb303ee10b1da9074db76e53bc9aa56c2c17..d2a5b33cd798e0c82ca862bc64c8de01c3c7620d 100644 (file)
 #endif
 
 #include <GL/glut.h>
-#include "../XGL/xgl.h"
+#include <XGL/xgl.h>
 #include <stdio.h>
 
-#include "GLUTkey.h"
-#include "fg_init.h"
-#include "views.h"
-
-#include "../Include/constants.h"
-#include "../Include/general.h"
-
-#include "../Aircraft/aircraft.h"
-#include "../Astro/moon.h"
-#include "../Astro/sky.h"
-#include "../Astro/stars.h"
-#include "../Astro/sun.h"
-#include "../Cockpit/cockpit.h"
-#include "../Joystick/joystick.h"
-#include "../Math/fg_geodesy.h"
-#include "../Math/mat3.h"
-#include "../Math/polar.h"
-#include "../Scenery/mesh.h"
-#include "../Scenery/scenery.h"
-#include "../Scenery/tilemgr.h"
-#include "../Time/event.h"
-#include "../Time/fg_time.h"
-#include "../Time/fg_timer.h"
-#include "../Time/sunpos.h"
-#include "../Weather/weather.h"
+#include <Main/GLUTkey.h>
+#include <Main/fg_init.h>
+#include <Main/fg_debug.h>
+#include <Main/views.h>
+
+#include <Include/fg_constants.h>
+#include <Include/general.h>
+
+#include <Aircraft/aircraft.h>
+#include <Astro/moon.h>
+#include <Astro/sky.h>
+#include <Astro/stars.h>
+#include <Astro/sun.h>
+#include <Cockpit/cockpit.h>
+#include <Joystick/joystick.h>
+#include <Math/fg_geodesy.h>
+#include <Math/mat3.h>
+#include <Math/polar.h>
+#include <Scenery/mesh.h>
+#include <Scenery/scenery.h>
+#include <Scenery/tilemgr.h>
+#include <Time/event.h>
+#include <Time/fg_time.h>
+#include <Time/fg_timer.h>
+#include <Time/sunpos.h>
+#include <Weather/weather.h>
 
 
 /* This is a record containing global housekeeping information */
@@ -70,7 +71,7 @@ static GLint winWidth, winHeight;
 /* pointer to scenery structure */
 /* static GLint scenery, runway; */
 
-double Simtime;
+/* double Simtime; */
 
 /* Another hack */
 int use_signals = 0;
@@ -86,7 +87,7 @@ int displayInstruments;
  * fgInitVisuals() -- Initialize various GL/view parameters
  **************************************************************************/
 
-static void fgInitVisuals() {
+static void fgInitVisuals( void ) {
     struct fgLIGHT *l;
     struct fgTIME *t;
     struct fgWEATHER *w;
@@ -121,7 +122,7 @@ static void fgInitVisuals() {
  * Update the view volume, position, and orientation
  **************************************************************************/
 
-static void fgUpdateViewParams() {
+static void fgUpdateViewParams( void ) {
     struct fgFLIGHT *f;
     struct fgLIGHT *l;
     struct fgTIME *t;
@@ -183,7 +184,7 @@ static void fgUpdateViewParams() {
 /*************************************************************************
  * Draw a basic instrument panel
  ************************************************************************/
-static void fgUpdateInstrViewParams() {
+static void fgUpdateInstrViewParams( void ) {
     xglViewport(0, 0 , (GLint)winWidth, (GLint)winHeight / 2);
   
     xglMatrixMode(GL_PROJECTION);
@@ -239,7 +240,7 @@ static void fgRenderFrame( void ) {
     /* update view volume parameters */
     fgUpdateViewParams();
 
-    xglClear( GL_DEPTH_BUFFER_BIT /* | GL_COLOR_BUFFER_BIT */ );
+    xglClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT );
 
     /* Tell GL we are switching to model view parameters */
     xglMatrixMode(GL_MODELVIEW);
@@ -357,7 +358,7 @@ void fgUpdateTimeDepCalcs(int multi_loop) {
 }
 
 
-void fgInitTimeDepCalcs() {
+void fgInitTimeDepCalcs( void ) {
     /* initialize timer */
 
 #ifdef USE_ITIMER
@@ -464,8 +465,8 @@ static void fgMainLoop( void ) {
     struct fgFLIGHT *f;
     struct fgTIME *t;
 
-    printf("Running Main Loop\n");
-    printf("======= ==== ====\n");
+    fgPrintf( FG_ALL, FG_DEBUG, "Running Main Loop\n");
+    fgPrintf( FG_ALL, FG_DEBUG, "======= ==== ====\n");
 
     a = &current_aircraft;
     f = &a->flight;
@@ -483,15 +484,15 @@ static void fgMainLoop( void ) {
 
     /* Calculate model iterations needed */
     elapsed = fgGetTimeInterval();
-    printf("Time interval is = %d, previous remainder is = %d\n", elapsed
-          remainder);
-    printf("--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
+    fgPrintf( FG_ALL, FG_BULK, "Time interval is = %d, previous remainder is = %d\n"
+             elapsed, remainder);
+    fgPrintf( FG_ALL, FG_BULK, "--> Frame rate is = %.2f\n", 1000.0 / (float)elapsed);
     elapsed += remainder;
 
     multi_loop = ((float)elapsed * 0.001) * DEFAULT_MODEL_HZ;
     remainder = elapsed - ((multi_loop*1000) / DEFAULT_MODEL_HZ);
-    printf("Model iterations needed = %d, new remainder = %d\n", multi_loop
-          remainder);
+    fgPrintf( FG_ALL, FG_BULK, "Model iterations needed = %d, new remainder = %d\n"
+             multi_loop, remainder);
 
     /* Run flight model */
     if ( ! use_signals ) {
@@ -513,14 +514,14 @@ static void fgMainLoop( void ) {
 
        /* now set aircraft altitude above ground */
        FG_Altitude = cur_elev * METER_TO_FEET + 3.758099;
-       printf("<*> resetting altitude to %.0f meters\n", 
+       fgPrintf( FG_ALL, FG_BULK, "<*> resetting altitude to %.0f meters\n", 
               FG_Altitude * FEET_TO_METER);
     }
 
-    /* fgAircraftOutputCurrent(a); */
+    fgAircraftOutputCurrent(a);
 
     /* see if we need to load any new scenery tiles */
-    /* fgTileMgrUpdate(); */
+    fgTileMgrUpdate();
 
     /* Process/manage pending events */
     fgEventProcess();
@@ -528,7 +529,7 @@ static void fgMainLoop( void ) {
     /* redraw display */
     fgRenderFrame();
 
-    printf("\n");
+    fgPrintf( FG_ALL, FG_DEBUG, "\n");
 }
 
 
@@ -630,15 +631,29 @@ int main( int argc, char *argv[] ) {
 
 #ifdef NO_PRINTF
   #include <stdarg.h>
-  int printf (const char *format, ...) {
-  }
+  int printf (const char *format, ...) {}
 #endif
 
 
 /* $Log$
-/* Revision 1.48  1998/01/19 18:35:46  curt
-/* Minor tweaks and fixes for cygwin32.
+/* Revision 1.52  1998/01/27 00:47:56  curt
+/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
+/* system and commandline/config file processing code.
 /*
+ * Revision 1.51  1998/01/26 15:57:05  curt
+ * Tweaks for dynamic scenery development.
+ *
+ * Revision 1.50  1998/01/19 19:27:07  curt
+ * Merged in make system changes from Bob Kuehne <rpk@sgi.com>
+ * This should simplify things tremendously.
+ *
+ * Revision 1.49  1998/01/19 18:40:31  curt
+ * Tons of little changes to clean up the code and to remove fatal errors
+ * when building with the c++ compiler.
+ *
+ * Revision 1.48  1998/01/19 18:35:46  curt
+ * Minor tweaks and fixes for cygwin32.
+ *
  * Revision 1.47  1998/01/13 00:23:08  curt
  * Initial changes to support loading and management of scenery tiles.  Note,
  * there's still a fair amount of work left to be done.