}
-#ifdef IS_THIS_BETTER_THAN_A_ZERO_CHARLIE
+#if 0
// Draw a basic instrument panel
static void fgUpdateInstrViewParams( void ) {
fgAPRun();
// printf("updating flight model x %d\n", multi_loop);
- fgFlightModelUpdate(current_options.get_flight_model(), f, multi_loop);
+ fgFlightModelUpdate( current_options.get_flight_model(),
+ cur_flight_params, multi_loop );
} else {
- fgFlightModelUpdate(current_options.get_flight_model(), f, 0);
+ fgFlightModelUpdate( current_options.get_flight_model(),
+ cur_flight_params, 0 );
}
// update the view angle
}
}
- double tmp = -(l->sun_rotation + FG_PI) - (FG_Psi - v->view_offset);
+ double tmp = -(l->sun_rotation + FG_PI) - (f->get_Psi() - v->view_offset);
while ( tmp < 0.0 ) {
tmp += FG_2PI;
}
FG_Altitude * FEET_TO_METER); */
if ( scenery.cur_elev > -9990 ) {
- if ( FG_Altitude * FEET_TO_METER <
+ if ( f->get_Altitude() * FEET_TO_METER <
(scenery.cur_elev + alt_adjust_m - 3.0) ) {
// now set aircraft altitude above ground
printf("Current Altitude = %.2f < %.2f forcing to %.2f\n",
- FG_Altitude * FEET_TO_METER,
+ f->get_Altitude() * FEET_TO_METER,
scenery.cur_elev + alt_adjust_m - 3.0,
scenery.cur_elev + alt_adjust_m );
- fgFlightModelSetAltitude( current_options.get_flight_model(), f,
+ fgFlightModelSetAltitude( current_options.get_flight_model(),
+ cur_flight_params,
scenery.cur_elev + alt_adjust_m );
FG_LOG( FG_ALL, FG_BULK,
"<*> resetting altitude to "
- << FG_Altitude * FEET_TO_METER << " meters" );
+ << f->get_Altitude() * FEET_TO_METER << " meters" );
}
- FG_Runway_altitude = scenery.cur_elev * METER_TO_FEET;
+ f->set_Runway_altitude( scenery.cur_elev * METER_TO_FEET );
}
/* printf("Adjustment - ground = %.2f runway = %.2f alt = %.2f\n",
FG_Runway_altitude * FEET_TO_METER,
FG_Altitude * FEET_TO_METER); */
- // fgAircraftOutputCurrent(a);
+ // Do any serial port work that might need to be done
+ fgSerialProcess();
// see if we need to load any new scenery tiles
fgTileMgrUpdate();
// Angle of Attack next... -x^3(e^x) is my best guess Just
// need to calculate some reasonable scaling factor and
// then clamp it on the positive aoa (neg adj) side
- double aoa = FG_Gamma_vert_rad * 2.2;
- double aoa_adj = pow(-aoa, 3) * pow(M_E, aoa);
+ double aoa = f->get_Gamma_vert_rad() * 2.2;
+ double tmp = 3.0;
+ double aoa_adj = pow(-aoa, tmp) * pow(M_E, aoa);
if (aoa_adj < -0.8) aoa_adj = -0.8;
pitch += aoa_adj;
//fprintf(stderr, "pitch3: %f ", pitch);
v->winWidth = width;
v->winHeight = height;
+ v->update_fov = true;
// Inform gl of our view window size (now handled elsewhere)
// xglViewport(0, 0, (GLint)width, (GLint)height);
// Define Display Parameters
xglutInitDisplayMode( GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE );
+ FG_LOG( FG_GENERAL, FG_INFO, "Opening a window: " <<
+ current_options.get_xsize() << "x" << current_options.get_ysize() );
+
// Define initial window size
- xglutInitWindowSize(640, 480);
+ xglutInitWindowSize( current_options.get_xsize(),
+ current_options.get_ysize() );
// Initialize windows
if ( current_options.get_game_mode() == 0 ) {
xglutCreateWindow("Flight Gear");
} else {
// Open the cool new 'game mode' window
- glutGameModeString("width=640 height=480 bpp=16");
+ string game_mode_params = "width=" + current_options.get_xsize();
+ game_mode_params += "height=" + current_options.get_ysize();
+ game_mode_params += " bpp=16";
+ cout << "game mode params = " << game_mode_params;
+ glutGameModeString( game_mode_params.c_str() );
glutEnterGameMode();
}
+ // 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 );
+
+ FG_LOG ( FG_GENERAL, FG_INFO, general.glRenderer );
+
+#if 0
+ // try to determine if we should adjust the initial default
+ // display resolution. The options class defaults (is
+ // initialized) to 640x480.
+ string renderer = general.glRenderer;
+
+ // currently we only know how to deal with Mesa/Glide/Voodoo cards
+ if ( renderer.find( "Glide" ) != string::npos ) {
+ FG_LOG( FG_GENERAL, FG_INFO, "Detected a Glide driver" );
+ if ( renderer.find( "FB/8" ) != string::npos ) {
+ // probably a voodoo-2
+ if ( renderer.find( "TMU/SLI" ) != string::npos ) {
+ // probably two SLI'd Voodoo-2's
+ current_options.set_xsize( 1024 );
+ current_options.set_ysize( 768 );
+ FG_LOG( FG_GENERAL, FG_INFO,
+ "It looks like you have two sli'd voodoo-2's." << endl
+ << "upgrading your win resolution to 1024 x 768" );
+ glutReshapeWindow(1024, 768);
+ } else {
+ // probably a single non-SLI'd Voodoo-2
+ current_options.set_xsize( 800 );
+ current_options.set_ysize( 600 );
+ FG_LOG( FG_GENERAL, FG_INFO,
+ "It looks like you have a voodoo-2." << endl
+ << "upgrading your win resolution to 800 x 600" );
+ glutReshapeWindow(800, 600);
+ }
+ } else if ( renderer.find( "FB/2" ) != string::npos ) {
+ // probably a voodoo-1, stick with the default
+ }
+ } else {
+ // we have no special knowledge of this card, stick with the default
+ }
+#endif
+
return(1);
}
// Initialize the [old] debugging output system
// fgInitDebug();
- FG_LOG( FG_GENERAL, FG_INFO, "Flight Gear: Version" << VERSION << endl );
+ // set default log levels
+ fglog().setLogLevels( FG_ALL, FG_INFO );
+
+ FG_LOG( FG_GENERAL, FG_INFO, "Flight Gear: Version " << VERSION << endl );
+
+ string root;
+
+ FG_LOG( FG_GENERAL, FG_INFO, "General Initialization" );
+ FG_LOG( FG_GENERAL, FG_INFO, "======= ==============" );
// Attempt to locate and parse a config file
// First check fg_root
// Something must have gone horribly wrong with the command
// line parsing or maybe the user just requested help ... :-)
current_options.usage();
- FG_LOG( FG_GENERAL, FG_ALERT, "\nExiting ...");
+ // FG_LOG( FG_GENERAL, FG_ALERT, "\nExiting ...");
+ cout << endl << "Exiting ..." << endl;
exit(-1);
}
// $Log$
+// Revision 1.70 1998/12/03 01:17:14 curt
+// Converted fgFLIGHT to a class.
+//
+// Revision 1.69 1998/11/23 20:51:26 curt
+// Fiddling with when I can get info from the opengl driver.
+//
+// Revision 1.68 1998/11/20 01:02:35 curt
+// Try to detect Mesa/Glide/Voodoo and chose the appropriate resolution.
+//
+// Revision 1.67 1998/11/16 13:59:58 curt
+// Added pow() macro bug work around.
+// Added support for starting FGFS at various resolutions.
+// Added some initial serial port support.
+// Specify default log levels in main().
+//
// Revision 1.66 1998/11/11 00:24:00 curt
// Added Michael Johnson's audio patches for testing.
// Also did a few tweaks to avoid numerical problems when starting at a place