]> git.mxchange.org Git - flightgear.git/commitdiff
Updated struct fgGENERAL to class FGGeneral.
authorcurt <curt>
Thu, 7 Jan 1999 20:24:43 +0000 (20:24 +0000)
committercurt <curt>
Thu, 7 Jan 1999 20:24:43 +0000 (20:24 +0000)
GUI/gui.cxx
Main/GLUTmain.cxx
Main/fg_init.cxx
Main/options.cxx
Main/views.cxx

index 902a6fdcf8009f25d1f2af7be2a1fc1b1b355d02..3a1441fad3646493d0ac3654c8ee60a1be7ae058 100644 (file)
@@ -26,7 +26,7 @@
 #include <stdlib.h>
 #include <string.h>
 
-#include <Include/general.h>
+#include <Include/general.hxx>
 #include <Main/options.hxx>
 
 #include "gui.h"
@@ -132,11 +132,8 @@ puCallback helpSubmenuCb        [] = { notCb, notCb, NULL };
 
 void guiInit()
 {
-    fgGENERAL *g;
     char *mesa_win_state;
 
-    g = &general;
-
     // Initialize PUI
     puInit();
 
@@ -144,7 +141,7 @@ void guiInit()
        // no preference specified for mouse pointer, attempt to autodetect...
        // Determine if we need to render the cursor, or if the windowing
        // system will do it.  First test if we are rendering with glide.
-       if ( strstr ( g->glRenderer, "Glide" ) ) {
+       if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
            // Test for the MESA_GLX_FX env variable
            if ( (mesa_win_state = getenv( "MESA_GLX_FX" )) != NULL) {
                // test if we are fullscreen mesa/glide
index 572e69215fafa0bcfbe693fa72dbca3ee3bf3539..261df03cb09faeca348ccf2e7f506d3d641c9fd9 100644 (file)
@@ -49,7 +49,7 @@
 #endif
 
 #include <Include/fg_constants.h>  // for VERSION
-#include <Include/general.h>
+#include <Include/general.hxx>
 
 #include <Aircraft/aircraft.hxx>
 #include <Astro/sky.hxx>
@@ -85,8 +85,8 @@
 #include "views.hxx"
 
 
-// This is a record containing global housekeeping information
-fgGENERAL general;
+// This is a record containing a bit of global housekeeping information
+FGGeneral general;
 
 // Specify our current idle function state.  This is used to run all
 // our initializations out of the glutIdleLoop() so that we can get a
@@ -450,7 +450,6 @@ static const double alt_adjust_m = alt_adjust_ft * FEET_TO_METER;
 // for the next move and update the display?
 static void fgMainLoop( void ) {
     FGState *f;
-    fgGENERAL *g;
     fgTIME *t;
     static int remainder = 0;
     int elapsed, multi_loop;
@@ -460,7 +459,6 @@ static void fgMainLoop( void ) {
     static int frames = 0;
 
     f = current_aircraft.fdm_state;
-    g = &general;
     t = &cur_time_params;
 
     FG_LOG( FG_ALL, FG_DEBUG, "Running Main Loop");
@@ -520,7 +518,7 @@ static void fgMainLoop( void ) {
 
     // Calculate frame rate average
     if ( (t->cur_time != last_time) && (last_time > 0) ) {
-       g->frame_rate = frames;
+       general.set_frame_rate( frames );
        frames = 0;
     }
     last_time = t->cur_time;
@@ -546,7 +544,7 @@ static void fgMainLoop( void ) {
     if ( ! use_signals ) {
        // Calculate model iterations needed for next frame
        FG_LOG( FG_ALL, FG_DEBUG, 
-               "--> Frame rate is = " << g->frame_rate );
+               "--> Frame rate is = " << general.get_frame_rate() );
        elapsed += remainder;
 
        multi_loop = (int)(((float)elapsed * 0.001) * DEFAULT_MODEL_HZ);
@@ -655,9 +653,6 @@ static void fgMainLoop( void ) {
 // then on.
 
 static void fgIdleFunction ( void ) {
-    fgGENERAL *g;
-    g = &general;
-
     // printf("idle state == %d\n", idle_state);
 
     if ( idle_state == 0 ) {
@@ -688,7 +683,7 @@ static void fgIdleFunction ( void ) {
        // "subsystems" but still need to be initialized.
 
 #ifdef USE_GLIDE
-       if ( strstr ( g->glRenderer, "Glide" ) ) {
+       if ( strstr ( general.get_glRenderer(), "Glide" ) ) {
            grTexLodBiasValue ( GR_TMU0, 1.0 ) ;
        }
 #endif
@@ -854,11 +849,11 @@ int fgGlutInit( int *argc, char **argv ) {
     // This seems to be the absolute earliest in the init sequence
     // that these calls will return valid info.  Too bad it's after
     // we've already created and sized out window. :-(
-    general.glVendor = (char *)glGetString ( GL_VENDOR );
-    general.glRenderer = (char *)glGetString ( GL_RENDERER );
-    general.glVersion = (char *)glGetString ( GL_VERSION );
+    general.set_glVendor( (char *)glGetString ( GL_VENDOR ) );
+    general.set_glRenderer( (char *)glGetString ( GL_RENDERER ) );
+    general.set_glVersion( (char *)glGetString ( GL_VERSION ) );
 
-    FG_LOG ( FG_GENERAL, FG_INFO, general.glRenderer );
+    FG_LOG ( FG_GENERAL, FG_INFO, general.get_glRenderer() );
 
 #if 0
     // try to determine if we should adjust the initial default
@@ -1007,6 +1002,9 @@ int main( int argc, char **argv ) {
 
 
 // $Log$
+// Revision 1.78  1999/01/07 20:25:08  curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
 // Revision 1.77  1998/12/18 23:40:55  curt
 // New frame rate counting mechanism.
 //
index b95f8b35b34a8837eadce8c3fab87428abd5f6fd..d6cf46f130d04b460a5c6e42cf1b3f79284511f9 100644 (file)
@@ -40,7 +40,6 @@
 #include <string>
 
 #include <Include/fg_constants.h>
-#include <Include/general.h>
 
 #include <Aircraft/aircraft.hxx>
 #include <Airports/simple.hxx>
@@ -49,7 +48,6 @@
 #include <Astro/solarsystem.hxx>
 #include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
-// #include <Debug/fg_debug.h>
 #include <Debug/logstream.hxx>
 #include <Joystick/joystick.hxx>
 #include <Math/fg_geodesy.hxx>
@@ -381,6 +379,9 @@ int fgInitSubsystems( void )
 
 
 // $Log$
+// Revision 1.60  1999/01/07 20:25:09  curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
 // Revision 1.59  1998/12/18 23:40:57  curt
 // New frame rate counting mechanism.
 //
index 98f09e59f47939ba1ea3cdacd377e45e53b36e9a..3d026eb9d79fbb569f4ed0685ae87bd00aead782 100644 (file)
@@ -617,6 +617,7 @@ void fgOPTIONS::usage ( void ) {
     printf("\t--units-meters:  Hud displays units in meters\n");
     printf("\t--hud-tris:  Hud displays number of triangles rendered\n");
     printf("\t--hud-culled:  Hud displays percentage of triangles culled\n");
+    printf("\n");
        
     printf("Time Options:\n");
     printf("\t--time-offset=[+-]hh:mm:ss:  offset local time by this amount\n");
@@ -629,6 +630,9 @@ fgOPTIONS::~fgOPTIONS( void ) {
 
 
 // $Log$
+// Revision 1.36  1999/01/07 20:25:10  curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
 // Revision 1.35  1998/12/06 14:52:57  curt
 // Fixed a problem with the initial starting altitude.  "v->abs_view_pos" wasn't
 // being calculated correctly at the beginning causing the first terrain
index 1d16ccf4a7313bf7ecb2a090e6062e0966a79ad1..651312b9c6bedd03eccd691c1e93fc9da8ef418b 100644 (file)
 #include "views.hxx"
 
 
+// temporary (hopefully) hack
+static int panel_hist = 0;
+
+
 // specify code paths ... these are done as variable rather than
 // #define's because down the road we may want to choose between them
 // on the fly for different flight models ... this way magic carpet
@@ -599,6 +603,9 @@ FGView::~FGView( void ) {
 
 
 // $Log$
+// Revision 1.32  1999/01/07 20:25:12  curt
+// Updated struct fgGENERAL to class FGGeneral.
+//
 // Revision 1.31  1998/12/11 20:26:28  curt
 // Fixed view frustum culling accuracy bug so we can look out the sides and
 // back without tri-stripes dropping out.