]> git.mxchange.org Git - flightgear.git/commitdiff
Patch from Jim Wilson:
authordavid <david>
Sat, 13 Apr 2002 13:11:34 +0000 (13:11 +0000)
committerdavid <david>
Sat, 13 Apr 2002 13:11:34 +0000 (13:11 +0000)
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
src/Main/location.hxx

index 319de0ddeef47318370c24f2f448c7d6aa750860..0c9fbd52192f0913d8ab1f39871924a5db1ea709 100644 (file)
@@ -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);
     }
 }
+
index d6d1b5ef89d3bc222139e754c310ab915b1058d5..44b2f12357389f39ba55e7745bd8d73dc641dbfd 100644 (file)
@@ -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:
 
 
 
+