]> git.mxchange.org Git - flightgear.git/commitdiff
Changes for new Astro code.
authorcurt <curt>
Tue, 15 Sep 1998 04:27:27 +0000 (04:27 +0000)
committercurt <curt>
Tue, 15 Sep 1998 04:27:27 +0000 (04:27 +0000)
Main/GLUTkey.cxx
Main/GLUTmain.cxx
Main/fg_init.cxx

index 904172e5dc891920509e45476cd985be31902bc7..00fbd831c3fb624428047814041e4f2fad8b9b55 100644 (file)
@@ -38,8 +38,9 @@
 #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>
@@ -62,7 +63,8 @@
 
 // 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();
 }
@@ -345,9 +347,12 @@ void GLUTspecialkey(int k, int x, int y) {
 
 
 /* $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.
index b53080a2e9cb010e8046020acb07a786cb8b92e5..a4e7ac902345d17809ea494fa688b182bf2dfdb2 100644 (file)
 #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>
@@ -310,24 +311,7 @@ static void fgRenderFrame( void ) {
 
        // 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();
 
@@ -888,6 +872,9 @@ int main( int argc, char **argv ) {
 
 
 // $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.
index 5f02eee73ec9bdb6a48cc6253cab876bf7c67a18..61589f1a5c1dab82ab349308d4d74e6eeb9d4cc6 100644 (file)
 
 #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>
@@ -299,8 +300,10 @@ int fgInitSubsystems( void )
     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() ) {
@@ -310,21 +313,27 @@ int fgInitSubsystems( void )
     }
 
     // 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();
@@ -389,6 +398,9 @@ int fgInitSubsystems( void )
 
 
 // $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.