]> git.mxchange.org Git - flightgear.git/commitdiff
Removed dependencies on Astro/solarsystem.*
authorcurt <curt>
Thu, 16 Mar 2000 23:01:57 +0000 (23:01 +0000)
committercurt <curt>
Thu, 16 Mar 2000 23:01:57 +0000 (23:01 +0000)
Pass star and planet data to Sky module.

src/Main/bfi.cxx
src/Main/fg_init.cxx
src/Main/main.cxx

index 5d0695118d7ec91bad0633e34645bf2b08674eb2..daef36e0a67c765b1f21464fa134586ebd6f0f71 100644 (file)
@@ -38,7 +38,7 @@
 #include <Controls/controls.hxx>
 #include <Autopilot/autopilot.hxx>
 #include <Time/fg_time.hxx>
-#include <Astro/solarsystem.hxx>
+#include <Time/light.hxx>
 #ifndef FG_OLD_WEATHER
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
 #else
@@ -120,7 +120,7 @@ FGBFI::reinit ()
   double gpsLongitude = getGPSTargetLongitude();
 
   fgReInitSubsystems();
-  solarSystemRebuild();
+  // solarSystemRebuild();
   cur_light_params.Update();
 
                                // Restore all of the old states.
index 3413c0c0e46e439ee7917acb40f8e58a17ca25d1..499641a1a5b3a2ff0c705a2c46e1b7abcecb469c 100644 (file)
@@ -58,7 +58,6 @@
 #include <Aircraft/aircraft.hxx>
 #include <Airports/simple.hxx>
 #include <Astro/stars.hxx>
-#include <Astro/solarsystem.hxx>
 #include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
 #include <FDM/Balloon.h>
@@ -381,19 +380,6 @@ bool fgInitSubsystems( void ) {
     FG_LOG( FG_GENERAL, FG_DEBUG, "  abs_view_pos = " << current_view.get_abs_view_pos());
     // current_view.UpdateWorldToEye(f);
 
-    // Build the solar system
-    //fgSolarSystemInit(*t);
-    FG_LOG(FG_GENERAL, FG_INFO, "Building SolarSystem");
-    SolarSystem::theSolarSystem = new SolarSystem(t);
-
-    // Initialize the Stars subsystem
-    if( fgStarsInit() ) {
-       // Stars initialized ok.
-    } else {
-       FG_LOG( FG_GENERAL, FG_ALERT, "Error in Stars initialization!" );
-       exit(-1);
-    }
-
     // Initialize the planetary subsystem
     // global_events.Register( "fgPlanetsInit()", fgPlanetsInit,
     //                     fgEVENT::FG_EVENT_READY, 600000);
@@ -406,10 +392,6 @@ bool fgInitSubsystems( void ) {
     // global_events.Register( "fgMoonInit()", fgMoonInit,
     //                     fgEVENT::FG_EVENT_READY, 600000 );
 
-    // register the periodic update of Sun, moon, and planets
-    global_events.Register( "ssolsysUpdate", solarSystemRebuild,
-                           fgEVENT::FG_EVENT_READY, 600000);
-
     // fgUpdateSunPos() needs a few position and view parameters set
     // so it can calculate local relative sun angle and a few other
     // things for correctly orienting the sky.
index 501ad143efa204d7c24e3019f4225b7d9242bd05..3f0689358beaae0d6732e7d639540782e0fb1ad2 100644 (file)
@@ -75,8 +75,6 @@
 
 #include <Aircraft/aircraft.hxx>
 #include <Astro/ephemeris.hxx>
-#include <Astro/stars.hxx>
-#include <Astro/solarsystem.hxx>
 
 #include <Autopilot/autopilot.hxx>
 #include <Cockpit/cockpit.hxx>
@@ -381,8 +379,9 @@ void fgRenderFrame( void ) {
                             cur_light_params.fog_color,
                             cur_light_params.sun_angle,
                             cur_light_params.moon_angle,
-                            0, NULL, 0, NULL );
-
+                            ephem->getNumPlanets(), ephem->getPlanets(),
+                            ephem->getNumStars(), ephem->getStars() );
            /* cout << "thesky->reposition( view_pos = " << view_pos[0] << " "
                 << view_pos[1] << " " << view_pos[2] << endl;
            cout << "    zero_elev = " << zero_elev[0] << " "
@@ -1149,7 +1148,6 @@ void fgReshape( int width, int height ) {
        // yes we've finished all our initializations and are running
        // the main loop, so this will now work without seg faulting
        // the system.
-       solarSystemRebuild();
        current_view.UpdateViewParams(cur_view_fdm);
        if ( current_options.get_panel_status() ) {
            FGPanel::OurPanel->ReInit(0, 0, 1024, 768);
@@ -1353,17 +1351,22 @@ int main( int argc, char **argv ) {
     scene->setName( "Scene" );
 
     // Initialize the sky
-    ephem = new FGEphemeris;
+    FGPath ephem_data_path( current_options.get_fg_root() );
+    ephem_data_path.append( "Astro" );
+    ephem = new FGEphemeris( ephem_data_path.c_str() );
     ephem->update( FGTime::cur_time_params, 0.0 );
+
     FGPath sky_tex_path( current_options.get_fg_root() );
     sky_tex_path.append( "Textures" );
     sky_tex_path.append( "Sky" );
     thesky = new SGSky;
     thesky->texture_path( sky_tex_path.str() );
+
     ssgBranch *sky = thesky->build( 550.0, 550.0,
                                    ephem->getNumPlanets(), 
                                    ephem->getPlanets(), 60000.0,
-                                   0, NULL, 60000.0 );
+                                   ephem->getNumStars(),
+                                   ephem->getStars(), 60000.0 );
     scene->addKid( sky );
 
     // Terrain branch