From 8767a84ffcdb41d3e784e279ad444a47bc4c6ee3 Mon Sep 17 00:00:00 2001 From: curt Date: Mon, 13 Jul 1998 15:32:37 +0000 Subject: [PATCH] Clear color buffer if drawing wireframe. When specifying and airport, start elevation at -1000 and let the system position you at ground level. --- Main/GLUTmain.cxx | 20 +++++++++++++++----- Main/fg_init.cxx | 7 ++++++- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/Main/GLUTmain.cxx b/Main/GLUTmain.cxx index d4db7439a..ecfa2b718 100644 --- a/Main/GLUTmain.cxx +++ b/Main/GLUTmain.cxx @@ -300,7 +300,8 @@ static void fgRenderFrame( void ) { GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 }; GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 }; GLfloat terrain_color[4] = { 0.54, 0.44, 0.29, 1.0 }; - + GLbitfield clear_mask; + f = current_aircraft.flight; l = &cur_light_params; o = ¤t_options; @@ -327,14 +328,18 @@ static void fgRenderFrame( void ) { // update view volume parameters fgUpdateViewParams(); + clear_mask = GL_DEPTH_BUFFER_BIT; + if ( o->wireframe ) { + clear_mask |= GL_COLOR_BUFFER_BIT; + } if ( o->skyblend ) { glClearColor(black[0], black[1], black[2], black[3]); - xglClear( GL_DEPTH_BUFFER_BIT ); } else { glClearColor(l->sky_color[0], l->sky_color[1], l->sky_color[2], l->sky_color[3]); - xglClear( GL_DEPTH_BUFFER_BIT | GL_COLOR_BUFFER_BIT ); + clear_mask |= GL_COLOR_BUFFER_BIT; } + xglClear( clear_mask ); // Tell GL we are switching to model view parameters xglMatrixMode(GL_MODELVIEW); @@ -520,11 +525,11 @@ static void fgMainLoop( void ) { if ( scenery.cur_elev > -9990 ) { if ( FG_Altitude * FEET_TO_METER < - (scenery.cur_elev + 3.758099 * FEET_TO_METER - 1.0) ) { + (scenery.cur_elev + 3.758099 * FEET_TO_METER - 3.0) ) { // now set aircraft altitude above ground printf("Current Altitude = %.2f < %.2f forcing to %.2f\n", FG_Altitude * FEET_TO_METER, - scenery.cur_elev + 3.758099 * FEET_TO_METER - 1.0, + scenery.cur_elev + 3.758099 * FEET_TO_METER - 3.0, scenery.cur_elev + 3.758099 * FEET_TO_METER); fgFlightModelSetAltitude( FG_LARCSIM, f, scenery.cur_elev + @@ -898,6 +903,11 @@ int main( int argc, char **argv ) { // $Log$ +// Revision 1.34 1998/07/13 15:32:37 curt +// Clear color buffer if drawing wireframe. +// When specifying and airport, start elevation at -1000 and let the system +// position you at ground level. +// // Revision 1.33 1998/07/12 03:14:42 curt // Added ground collision detection. // Did some serious horsing around to be able to "hug" the ground properly diff --git a/Main/fg_init.cxx b/Main/fg_init.cxx index 6c291cca1..cb5bb2236 100644 --- a/Main/fg_init.cxx +++ b/Main/fg_init.cxx @@ -154,7 +154,7 @@ int fgInitPosition( void ) { } else { FG_Longitude = ( a.longitude ) * DEG_TO_RAD; FG_Latitude = ( a.latitude ) * DEG_TO_RAD; - FG_Runway_altitude = ( a.elevation ); + FG_Runway_altitude = ( -1000 /* a.elevation */ ); FG_Altitude = FG_Runway_altitude + 3.758099; } } @@ -395,6 +395,11 @@ int fgInitSubsystems( void ) { // $Log$ +// Revision 1.24 1998/07/13 15:32:39 curt +// Clear color buffer if drawing wireframe. +// When specifying and airport, start elevation at -1000 and let the system +// position you at ground level. +// // Revision 1.23 1998/07/12 03:14:43 curt // Added ground collision detection. // Did some serious horsing around to be able to "hug" the ground properly -- 2.39.2