#include <stdlib.h>
#include <Aircraft/aircraft.h>
-#include <Astro/orbits.hxx>
-#include <Astro/sun.hxx>
+// #include <Astro/orbits.hxx>
+// #include <Astro/sun.hxx>
+#include <Astro/solarsystem.hxx>
#include <Astro/sky.hxx>
#include <Autopilot/autopilot.h> // Added autopilot.h to list, Jeff Goeke-Smith
#include <Cockpit/hud.hxx>
// Force an update of the sky and lighting parameters
static void local_update_sky_and_lighting_params( void ) {
- fgSunInit();
+ // fgSunInit();
+ SolarSystem::theSolarSystem->rebuild();
cur_light_params.Update();
fgSkyColorsInit();
}
/* $Log$
-/* Revision 1.21 1998/08/29 13:09:25 curt
-/* Changes to event manager from Bernie Bright.
+/* Revision 1.22 1998/09/15 04:27:27 curt
+/* Changes for new Astro code.
/*
+ * Revision 1.21 1998/08/29 13:09:25 curt
+ * Changes to event manager from Bernie Bright.
+ *
* Revision 1.20 1998/08/24 20:11:12 curt
* Added i/I to toggle full vs. minimal HUD.
* Added a --hud-tris vs --hud-culled option.
#include <Include/general.h>
#include <Aircraft/aircraft.h>
-#include <Astro/moon.hxx>
-#include <Astro/planets.hxx>
+//#include <Astro/moon.hxx>
+//#include <Astro/planets.hxx>
#include <Astro/sky.hxx>
#include <Astro/stars.hxx>
-#include <Astro/sun.hxx>
+//#include <Astro/sun.hxx>
+#include <Astro/solarsystem.hxx>
#ifdef ENABLE_AUDIO_SUPPORT
# include <Audio/src/sl.h>
// draw stars and planets
fgStarsRender();
- fgPlanetsRender();
-
- // draw the sun
- fgSunRender();
-
- // render the moon
- xglEnable( GL_LIGHTING );
- xglEnable( GL_LIGHT0 );
- // set lighting parameters
- xglLightfv(GL_LIGHT0, GL_AMBIENT, white );
- xglLightfv(GL_LIGHT0, GL_DIFFUSE, white );
- xglEnable( GL_CULL_FACE );
-
- // Let's try some blending technique's (Durk)
- glEnable(GL_BLEND);
- glBlendFunc(GL_ONE, GL_ONE);
- fgMoonRender();
- glDisable(GL_BLEND);
+ SolarSystem::theSolarSystem->draw();
xglPopMatrix();
// $Log$
+// Revision 1.51 1998/09/15 04:27:28 curt
+// Changes for new Astro code.
+//
// Revision 1.50 1998/09/15 02:09:24 curt
// Include/fg_callback.hxx
// Moved code inline to stop g++ 2.7 from complaining.
#include <Aircraft/aircraft.h>
#include <Airports/simple.hxx>
-#include <Astro/moon.hxx>
-#include <Astro/planets.hxx>
+// #include <Astro/moon.hxx>
+// #include <Astro/planets.hxx>
#include <Astro/sky.hxx>
#include <Astro/stars.hxx>
-#include <Astro/sun.hxx>
+// #include <Astro/sun.hxx>
+#include <Astro/solarsystem.hxx>
#include <Autopilot/autopilot.h>
#include <Cockpit/cockpit.hxx>
#include <Debug/fg_debug.h>
v->UpdateViewMath(f);
v->UpdateWorldToEye(f);
- // Initialize the orbital elements of sun, moon and mayor planets
- fgSolarSystemInit(*t);
+ // Build the solar system
+ //fgSolarSystemInit(*t);
+ fgPrintf(FG_GENERAL, FG_INFO, "Building SolarSystem\n");
+ SolarSystem::theSolarSystem = new SolarSystem(t);
// Initialize the Stars subsystem
if( fgStarsInit() ) {
}
// Initialize the planetary subsystem
- global_events.Register( "fgPlanetsInit()", fgPlanetsInit,
- fgEVENT::FG_EVENT_READY, 600000);
+ // global_events.Register( "fgPlanetsInit()", fgPlanetsInit,
+ // fgEVENT::FG_EVENT_READY, 600000);
// Initialize the sun's position
- global_events.Register( "fgSunInit()", fgSunInit,
- fgEVENT::FG_EVENT_READY, 30000 );
+ // global_events.Register( "fgSunInit()", fgSunInit,
+ // fgEVENT::FG_EVENT_READY, 30000 );
// Intialize the moon's position
- global_events.Register( "fgMoonInit()", fgMoonInit,
- fgEVENT::FG_EVENT_READY, 600000 );
+ // 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.
fgUpdateSunPos();
+ global_events.Register( "fgUpdateSunPos()", fgUpdateSunPos,
+ fgEVENT::FG_EVENT_READY, 60000);
// Initialize Lighting interpolation tables
l->Init();
// $Log$
+// Revision 1.38 1998/09/15 04:27:30 curt
+// Changes for new Astro code.
+//
// Revision 1.37 1998/09/15 02:09:26 curt
// Include/fg_callback.hxx
// Moved code inline to stop g++ 2.7 from complaining.