]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Disable two sided light model because Andy's patch to plib makes it unneeded. This...
[flightgear.git] / src / Main / main.cxx
index 0056925c2dc3eb28fdb3c76ce5f2dd1c1228cd48..dc8c5a8da3b577598fa6c598c5d384bf8bd8671d 100644 (file)
@@ -64,7 +64,6 @@
 
 #include <Include/general.hxx>
 #include <Scenery/tileentry.hxx>
-#include <Time/FGEventMgr.hxx>
 #include <Time/light.hxx>
 #include <Time/light.hxx>
 #include <Aircraft/aircraft.hxx>
@@ -133,8 +132,6 @@ bool glPointParameterIsSupported = false;
 #  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;
 
@@ -374,9 +371,6 @@ void fgRenderFrame() {
     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
@@ -510,18 +504,18 @@ void fgRenderFrame() {
         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;
@@ -549,7 +543,7 @@ void fgRenderFrame() {
              << " 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()
@@ -1019,6 +1013,8 @@ static void fgMainLoop( void ) {
 
     SGTime *t = globals->get_time_params();
 
+    globals->get_event_mgr()->update(delta_time_sec);
+
     SGLocation * acmodel_location = 0;
     if(cur_fdm_state->getACModel() != 0) {
       acmodel_location = (SGLocation *)  cur_fdm_state->getACModel()->get3DModel()->getSGLocation();
@@ -1251,10 +1247,11 @@ static void fgMainLoop( void ) {
     // 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
@@ -1553,7 +1550,7 @@ bool fgMainInit( int argc, char **argv ) {
     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