From 3e918d1df178ed1e53d8f99cb36b7a0ae93bd0b9 Mon Sep 17 00:00:00 2001 From: curt Date: Wed, 27 Jan 1999 04:49:17 +0000 Subject: [PATCH] Game mode fixes from Norman Vine. Initial altitude setting tweaks and fixes (especially for when starting below sea level.) --- Main/GLUTmain.cxx | 18 +++++++++++++----- Main/fg_init.cxx | 28 ++++++++++++++++++++++------ 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index c4558cb25..99f3508f9 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -839,11 +839,14 @@ int fgGlutInit( int *argc, char **argv ) { xglutCreateWindow("Flight Gear"); } else { // Open the cool new 'game mode' window - 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() ); + char game_mode_str[256]; + sprintf( game_mode_str, "width=%d height=%d bpp=16", + current_options.get_xsize(), + current_options.get_ysize() ); + + FG_LOG( FG_GENERAL, FG_INFO, + "game mode params = " << game_mode_str ); + glutGameModeString( game_mode_str ); glutEnterGameMode(); } @@ -1003,6 +1006,11 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.83 1999/01/27 04:49:17 curt +// Game mode fixes from Norman Vine. +// Initial altitude setting tweaks and fixes (especially for when starting +// below sea level.) +// // Revision 1.82 1999/01/20 13:42:24 curt // Tweaked FDM interface. // Testing check sum support for NMEA serial output. diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index 45f00f274..9bb23d514 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -189,30 +189,41 @@ int fgInitSubsystems( void ) exit(-1); } + FG_LOG( FG_GENERAL, FG_DEBUG, + "Current terrain elevation after tile mgr init " << + scenery.cur_elev ); + // Calculate ground elevation at starting point (we didn't have // tmp_abs_view_pos calculated when fgTileMgrUpdate() was called above - + // // calculalate a cartesian point somewhere along the line between // the center of the earth and our view position. Doesn't have to // be the exact elevation (this is good because we don't know it // yet :-) + + // now handled inside of the fgTileMgrUpdate() + + /* geod_pos = Point3D( f->get_Longitude(), f->get_Latitude(), 0.0); tmp_abs_view_pos = fgGeodToCart(geod_pos); - FG_LOG( FG_GENERAL, FG_DEBUG, - "Altitude before update " << scenery.cur_elev ); FG_LOG( FG_GENERAL, FG_DEBUG, "Initial abs_view_pos = " << tmp_abs_view_pos ); scenery.cur_elev = - fgTileMgrCurElevOLD( f->get_Longitude(), - f->get_Latitude(), - tmp_abs_view_pos ); + fgTileMgrCurElev( f->get_Longitude(), f->get_Latitude(), + tmp_abs_view_pos ); FG_LOG( FG_GENERAL, FG_DEBUG, "Altitude after update " << scenery.cur_elev ); + */ + fgFDMSetGroundElevation( current_options.get_flight_model(), scenery.cur_elev ); // Reset our altitude if we are below ground + FG_LOG( FG_GENERAL, FG_DEBUG, "Current altitude = " << f->get_Altitude() ); + FG_LOG( FG_GENERAL, FG_DEBUG, "Current runway altitude = " << + f->get_Runway_altitude() ); + if ( f->get_Altitude() < f->get_Runway_altitude() + 3.758099) { f->set_Altitude( f->get_Runway_altitude() + 3.758099 ); } @@ -381,6 +392,11 @@ int fgInitSubsystems( void ) // $Log$ +// Revision 1.63 1999/01/27 04:49:19 curt +// Game mode fixes from Norman Vine. +// Initial altitude setting tweaks and fixes (especially for when starting +// below sea level.) +// // Revision 1.62 1999/01/20 13:42:25 curt // Tweaked FDM interface. // Testing check sum support for NMEA serial output. -- 2.39.5