From 39416c285535cb6b3e76ac8a3e5dc441b46d1bba Mon Sep 17 00:00:00 2001 From: david Date: Sat, 13 Apr 2002 13:11:34 +0000 Subject: [PATCH] Patch from Jim Wilson: Minor fixes. Made some changes to get lighting correct for time of day for now. MSVC compatibility fix and returned to clearing z-buffer only in LOOKFROM (formerly pilot view). [dpm: removed the last one, since I had already made a similar patch] --- src/Main/fg_init.cxx | 19 ++++++++++++------- src/Main/location.hxx | 9 +++++---- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/Main/fg_init.cxx b/src/Main/fg_init.cxx index 319de0dde..0c9fbd521 100644 --- a/src/Main/fg_init.cxx +++ b/src/Main/fg_init.cxx @@ -640,6 +640,8 @@ void fgInitFDM() { // Initialize view parameters void fgInitView() { + // force update of model so that viewer can get some data... + globals->get_aircraft_model()->update(0); globals->get_viewmgr()->update(0); } @@ -769,6 +771,13 @@ bool fgInitSubsystems( void ) { fgAircraftInit(); // In the future this might not be the case. + //////////////////////////////////////////////////////////////////// + // Initialize the view manager subsystem. + //////////////////////////////////////////////////////////////////// + + fgInitView(); + + //////////////////////////////////////////////////////////////////// // Initialize the event manager subsystem. //////////////////////////////////////////////////////////////////// @@ -781,13 +790,6 @@ bool fgInitSubsystems( void ) { 60000 ); - //////////////////////////////////////////////////////////////////// - // Initialize the view manager subsystem. - //////////////////////////////////////////////////////////////////// - - fgInitView(); - - //////////////////////////////////////////////////////////////////// // Initialize the lighting subsystem. //////////////////////////////////////////////////////////////////// @@ -805,6 +807,8 @@ bool fgInitSubsystems( void ) { // Initialize Lighting interpolation tables l->Init(); + // force one lighting update to make it right to start with... + l->Update(); // update the lighting parameters (based on sun angle) global_events.Register( "fgLight::Update()", &cur_light_params, &fgLIGHT::Update, @@ -1126,3 +1130,4 @@ void fgReInitSubsystems( void ) fgSetBool("/sim/freeze/master", false); } } + diff --git a/src/Main/location.hxx b/src/Main/location.hxx index d6d1b5ef8..44b2f1235 100644 --- a/src/Main/location.hxx +++ b/src/Main/location.hxx @@ -108,10 +108,10 @@ public: virtual float *get_surface_south() { return _surface_south; } // Matrices... - virtual const sgMat4 &getTransformMatrix() { if ( _dirty ) { recalc(); } return TRANS; } - virtual const sgMat4 &getCachedTransformMatrix() { return TRANS; } - virtual const sgMat4 &getUpMatrix() { if ( _dirty ) { recalc(); } return UP; } - virtual const sgMat4 &getCachedUpMatrix() { return UP; } + virtual const sgVec4 * getTransformMatrix() { if ( _dirty ) { recalc(); } return TRANS; } + virtual const sgVec4 * getCachedTransformMatrix() { return TRANS; } + virtual const sgVec4 * getUpMatrix() { if ( _dirty ) { recalc(); } return UP; } + virtual const sgVec4 * getCachedUpMatrix() { return UP; } private: @@ -176,3 +176,4 @@ private: +