From: curt Date: Wed, 7 Nov 2001 04:55:57 +0000 (+0000) Subject: Tweaks to get startup time, relative sun angle, sky colors, etc. to be X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e19d4567167faaacdd1f18d363ee3acb8b53c041;p=flightgear.git Tweaks to get startup time, relative sun angle, sky colors, etc. to be properly initialized. --- diff --git a/aclocal.m4 b/aclocal.m4 index 78a4037e5..7d5836b91 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,4 +1,4 @@ -dnl aclocal.m4 generated automatically by aclocal 1.4 +dnl aclocal.m4 generated automatically by aclocal 1.4-p4 dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 8ef3e2c58..5b4e91a8d 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -487,6 +487,13 @@ bool fgInitGeneral( void ) { // gear, its initialization call should located in this routine. // Returns non-zero if a problem encountered. bool fgInitSubsystems( void ) { + static const SGPropertyNode *longitude + = fgGetNode("/position/longitude-deg"); + static const SGPropertyNode *latitude + = fgGetNode("/position/latitude-deg"); + static const SGPropertyNode *altitude + = fgGetNode("/position/altitude-ft"); + fgLIGHT *l = &cur_light_params; SG_LOG( SG_GENERAL, SG_INFO, "Initialize Subsystems"); @@ -600,12 +607,12 @@ bool fgInitSubsystems( void ) { FGViewerRPH *pilot_view = (FGViewerRPH *)globals->get_viewmgr()->get_view( 0 ); - pilot_view->set_geod_view_pos( cur_fdm_state->get_Longitude(), - cur_fdm_state->get_Lat_geocentric(), - cur_fdm_state->get_Altitude() * - SG_FEET_TO_METER ); - pilot_view->set_sea_level_radius( cur_fdm_state->get_Sea_level_radius() * - SG_FEET_TO_METER ); + pilot_view->set_geod_view_pos( longitude->getDoubleValue() + * SGD_DEGREES_TO_RADIANS, + latitude->getDoubleValue() + * SGD_DEGREES_TO_RADIANS, + altitude->getDoubleValue() + * SG_FEET_TO_METER ); pilot_view->set_rph( cur_fdm_state->get_Phi(), cur_fdm_state->get_Theta(), cur_fdm_state->get_Psi() ); diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 79c3849c9..42b6ce059 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1095,7 +1095,7 @@ static void fgMainLoop( void ) { cur_fdm_state->get_Runway_altitude() * SG_FEET_TO_METER, cur_fdm_state->get_Altitude() * SG_FEET_TO_METER); */ - if ( scenery.get_cur_elev() > -9990 ) { + if ( scenery.get_cur_elev() > -9990 && cur_fdm_state->get_inited() ) { if ( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER < (scenery.get_cur_elev() + alt_adjust_m - 3.0) ) { // now set aircraft altitude above ground diff --git a/src/Scenery/tilemgr.cxx b/src/Scenery/tilemgr.cxx index fec39fa20..06c0e8bb5 100644 --- a/src/Scenery/tilemgr.cxx +++ b/src/Scenery/tilemgr.cxx @@ -251,7 +251,8 @@ void FGTileMgr::initialize_queue() // chunks. If the chunk isn't already in the cache, then read it from // disk. int FGTileMgr::update( double lon, double lat ) { - SG_LOG( SG_TERRAIN, SG_INFO, "FGTileMgr::update() for " << lon << " " << lat ); + SG_LOG( SG_TERRAIN, SG_DEBUG, "FGTileMgr::update() for " + << lon << " " << lat ); longitude = lon; latitude = lat; @@ -381,7 +382,8 @@ int FGTileMgr::update( double lon, double lat ) { scenery.set_cur_normal( tmp_normal ); } else { scenery.set_cur_elev( -9999.0 ); - } + } + // cout << "Current elevation = " << scenery.get_cur_elev() << endl; #if 0 } #endif