#include <Include/general.hxx>
#include <Scenery/tileentry.hxx>
-#include <Time/FGEventMgr.hxx>
#include <Time/light.hxx>
#include <Time/light.hxx>
#include <Aircraft/aircraft.hxx>
# include <console.h> // -dw- for command line dialog
#endif
-FGEventMgr global_events;
-
// This is a record containing a bit of global housekeeping information
FGGeneral general;
// we need a white diffuse light for the phase of the moon
ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, white );
- thesky->preDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER );
+ thesky->preDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER, fog_exp2_density );
// draw the ssg scene
// return to the desired diffuse color
GLfloat black[4] = { 0.0, 0.0, 0.0, 1.0 };
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
- // Process/manage pending events
- global_events.update( delta_time_sec );
-
// static const SGPropertyNode *longitude
// = fgGetNode("/position/longitude-deg");
// static const SGPropertyNode *latitude
if ( skyblend ) {
/*
SG_LOG( SG_GENERAL, SG_BULK, "thesky->repaint() sky_color = "
- << cur_light_params.sky_color[0] << " "
- << cur_light_params.sky_color[1] << " "
- << cur_light_params.sky_color[2] << " "
- << cur_light_params.sky_color[3] );
+ << l->sky_color()[0] << " "
+ << l->sky_color()[1] << " "
+ << l->sky_color()[2] << " "
+ << l->sky_color()[3] );
SG_LOG( SG_GENERAL, SG_BULK, " fog = "
- << cur_light_params.fog_color[0] << " "
- << cur_light_params.fog_color[1] << " "
- << cur_light_params.fog_color[2] << " "
- << cur_light_params.fog_color[3] );
+ << l->fog_color()[0] << " "
+ << l->fog_color()[1] << " "
+ << l->fog_color()[2] << " "
+ << l->fog_color()[3] );
SG_LOG( SG_GENERAL, SG_BULK,
- " sun_angle = " << cur_light_params.sun_angle
- << " moon_angle = " << cur_light_params.moon_angle );
+ " sun_angle = " << l->sun_angle
+ << " moon_angle = " << l->moon_angle );
*/
static SGSkyColor scolor;
<< " lon = " << cur_fdm_state->get_Longitude()
<< " lat = " << cur_fdm_state->get_Latitude() );
SG_LOG( SG_GENERAL, SG_BULK,
- " sun_rot = " << cur_light_params.sun_rotation
+ " sun_rot = " << l->get_sun_rotation
<< " gst = " << SGTime::cur_time_params->getGst() );
SG_LOG( SG_GENERAL, SG_BULK,
" sun ra = " << globals->get_ephem()->getSunRightAscension()
// we need a white diffuse light for the phase of the moon
ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, white );
- thesky->preDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER );
+ thesky->preDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER, fog_exp2_density );
// return to the desired diffuse color
ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse() );
-
- // FIXME: This should not be needed, but at this time (08/15/2003)
- // certain NVidia drivers don't seem to implement
- // fgPushAttrib(FG_FOG_BIT) properly. The result is that
- // there is not fog when looking at the sun.
- glFogf ( GL_FOG_DENSITY, fog_exp2_density );
}
// draw the ssg scene
SGTime *t = globals->get_time_params();
- sglog().setLogLevels( SG_ALL, (sgDebugPriority)fgGetInt("/sim/log-level") );
+ globals->get_event_mgr()->update(delta_time_sec);
SGLocation * acmodel_location = 0;
if(cur_fdm_state->getACModel() != 0) {
cur_time_override->getLongValue(),
globals->get_warp() );
+ if (globals->get_warp_delta() != 0) {
+ FGLight *l = (FGLight *)(globals->get_subsystem("lighting"));
+ l->update( 0.5 );
+ }
+
// update magvar model
globals->get_mag()->update( longitude->getDoubleValue()
* SGD_DEGREES_TO_RADIANS,
// END Tile Manager udpates
if (fgGetBool("/sim/rendering/specular-highlight")) {
- glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR); glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
+ glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SEPARATE_SPECULAR_COLOR);
+ // glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_TRUE);
} else {
glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR);
- glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
+ // glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
}
// redraw display
fgInitFGRoot(argc, argv);
// Check for the correct base package version
- static char required_version[] = "0.9.2";
+ static char required_version[] = "0.9.3";
string base_version = fgBasePackageVersion();
if ( !(base_version == required_version) ) {
// tell the operator how to use this application