Changes for new Astro code.
This commit is contained in:
parent
a7ebfb4b65
commit
6f91b7db68
3 changed files with 41 additions and 37 deletions
|
@ -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.
|
||||
|
|
|
@ -53,11 +53,12 @@
|
|||
#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.
|
||||
|
|
|
@ -44,11 +44,12 @@
|
|||
|
||||
#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.
|
||||
|
|
Loading…
Reference in a new issue