From: curt Date: Thu, 7 Jan 1999 20:24:43 +0000 (+0000) Subject: Updated struct fgGENERAL to class FGGeneral. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e8d0a16e41d526a919ea79acf89829bfef17fe71;p=flightgear.git Updated struct fgGENERAL to class FGGeneral. --- diff --git a/GUI/gui.cxx b/GUI/gui.cxx index 902a6fdcf..3a1441fad 100644 --- a/GUI/gui.cxx +++ b/GUI/gui.cxx @@ -26,7 +26,7 @@ #include #include -#include +#include #include
#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 diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index 572e69215..261df03cb 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -49,7 +49,7 @@ #endif #include // for VERSION -#include +#include #include #include @@ -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. // diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index b95f8b35b..d6cf46f13 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -40,7 +40,6 @@ #include #include -#include #include #include @@ -49,7 +48,6 @@ #include #include #include -// #include #include #include #include @@ -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. // diff --git a/Main/options.cxx b/Main/options.cxx index 98f09e59f..3d026eb9d 100644 --- a/Main/options.cxx +++ b/Main/options.cxx @@ -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 diff --git a/Main/views.cxx b/Main/views.cxx index 1d16ccf4a..651312b9c 100644 --- a/Main/views.cxx +++ b/Main/views.cxx @@ -42,6 +42,10 @@ #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.