1
0
Fork 0

Removed dependencies on Astro/solarsystem.*

Pass star and planet data to Sky module.
This commit is contained in:
curt 2000-03-16 23:01:57 +00:00
parent 7e142df1a2
commit 84c64c8cc3
3 changed files with 12 additions and 27 deletions

View file

@ -38,7 +38,7 @@
#include <Controls/controls.hxx> #include <Controls/controls.hxx>
#include <Autopilot/autopilot.hxx> #include <Autopilot/autopilot.hxx>
#include <Time/fg_time.hxx> #include <Time/fg_time.hxx>
#include <Astro/solarsystem.hxx> #include <Time/light.hxx>
#ifndef FG_OLD_WEATHER #ifndef FG_OLD_WEATHER
# include <WeatherCM/FGLocalWeatherDatabase.h> # include <WeatherCM/FGLocalWeatherDatabase.h>
#else #else
@ -120,7 +120,7 @@ FGBFI::reinit ()
double gpsLongitude = getGPSTargetLongitude(); double gpsLongitude = getGPSTargetLongitude();
fgReInitSubsystems(); fgReInitSubsystems();
solarSystemRebuild(); // solarSystemRebuild();
cur_light_params.Update(); cur_light_params.Update();
// Restore all of the old states. // Restore all of the old states.

View file

@ -58,7 +58,6 @@
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Airports/simple.hxx> #include <Airports/simple.hxx>
#include <Astro/stars.hxx> #include <Astro/stars.hxx>
#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx> #include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
#include <FDM/Balloon.h> #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()); FG_LOG( FG_GENERAL, FG_DEBUG, " abs_view_pos = " << current_view.get_abs_view_pos());
// current_view.UpdateWorldToEye(f); // 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 // Initialize the planetary subsystem
// global_events.Register( "fgPlanetsInit()", fgPlanetsInit, // global_events.Register( "fgPlanetsInit()", fgPlanetsInit,
// fgEVENT::FG_EVENT_READY, 600000); // fgEVENT::FG_EVENT_READY, 600000);
@ -406,10 +392,6 @@ bool fgInitSubsystems( void ) {
// global_events.Register( "fgMoonInit()", fgMoonInit, // global_events.Register( "fgMoonInit()", fgMoonInit,
// fgEVENT::FG_EVENT_READY, 600000 ); // 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 // fgUpdateSunPos() needs a few position and view parameters set
// so it can calculate local relative sun angle and a few other // so it can calculate local relative sun angle and a few other
// things for correctly orienting the sky. // things for correctly orienting the sky.

View file

@ -75,8 +75,6 @@
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Astro/ephemeris.hxx> #include <Astro/ephemeris.hxx>
#include <Astro/stars.hxx>
#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.hxx> #include <Autopilot/autopilot.hxx>
#include <Cockpit/cockpit.hxx> #include <Cockpit/cockpit.hxx>
@ -381,7 +379,8 @@ void fgRenderFrame( void ) {
cur_light_params.fog_color, cur_light_params.fog_color,
cur_light_params.sun_angle, cur_light_params.sun_angle,
cur_light_params.moon_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] << " " /* cout << "thesky->reposition( view_pos = " << view_pos[0] << " "
<< view_pos[1] << " " << view_pos[2] << endl; << view_pos[1] << " " << view_pos[2] << endl;
@ -1149,7 +1148,6 @@ void fgReshape( int width, int height ) {
// yes we've finished all our initializations and are running // yes we've finished all our initializations and are running
// the main loop, so this will now work without seg faulting // the main loop, so this will now work without seg faulting
// the system. // the system.
solarSystemRebuild();
current_view.UpdateViewParams(cur_view_fdm); current_view.UpdateViewParams(cur_view_fdm);
if ( current_options.get_panel_status() ) { if ( current_options.get_panel_status() ) {
FGPanel::OurPanel->ReInit(0, 0, 1024, 768); FGPanel::OurPanel->ReInit(0, 0, 1024, 768);
@ -1353,17 +1351,22 @@ int main( int argc, char **argv ) {
scene->setName( "Scene" ); scene->setName( "Scene" );
// Initialize the sky // 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 ); ephem->update( FGTime::cur_time_params, 0.0 );
FGPath sky_tex_path( current_options.get_fg_root() ); FGPath sky_tex_path( current_options.get_fg_root() );
sky_tex_path.append( "Textures" ); sky_tex_path.append( "Textures" );
sky_tex_path.append( "Sky" ); sky_tex_path.append( "Sky" );
thesky = new SGSky; thesky = new SGSky;
thesky->texture_path( sky_tex_path.str() ); thesky->texture_path( sky_tex_path.str() );
ssgBranch *sky = thesky->build( 550.0, 550.0, ssgBranch *sky = thesky->build( 550.0, 550.0,
ephem->getNumPlanets(), ephem->getNumPlanets(),
ephem->getPlanets(), 60000.0, ephem->getPlanets(), 60000.0,
0, NULL, 60000.0 ); ephem->getNumStars(),
ephem->getStars(), 60000.0 );
scene->addKid( sky ); scene->addKid( sky );
// Terrain branch // Terrain branch