]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Frederic Bouvier:
[flightgear.git] / src / Main / main.cxx
index 82d9de780726bf0a69e803292c5af1861dbbf300..4f2947fbd654495e075b629d21bd620c6165de80 100644 (file)
@@ -43,6 +43,7 @@
 
 #include <plib/ssg.h>
 #include <plib/pu.h>
+#include <plib/netSocket.h>
 
 #include <simgear/screen/extensions.hxx>
 #include <simgear/scene/material/matlib.hxx>
 #include "splash.hxx"
 #include "fg_commands.hxx"
 #include "fg_io.hxx"
-
-
-glPointParameterfProc glPointParameterfPtr = 0;
-glPointParameterfvProc glPointParameterfvPtr = 0;
-bool glPointParameterIsSupported = false;
+#include "main.hxx"
 
 float default_attenuation[3] = {1.0, 0.0, 0.0};
-//Required for using GL_extensions
-void fgLoadDCS (void);
-void fgUpdateDCS (void);
 ssgSelector *ship_sel=NULL;
 // upto 32 instances of a same object can be loaded.
 ssgTransform *ship_pos[32];
@@ -126,6 +120,10 @@ float scene_farplane = 120000.0f;
 
 static double delta_time_sec = 0.0;
 
+glPointParameterfProc glPointParameterfPtr = 0;
+glPointParameterfvProc glPointParameterfvPtr = 0;
+bool glPointParameterIsSupported = false;
+
 
 #ifdef FG_WEATHERCM
 #  include <WeatherCM/FGLocalWeatherDatabase.h>
@@ -1291,6 +1289,13 @@ 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);
+    } else {
+        glLightModeli(GL_LIGHT_MODEL_COLOR_CONTROL, GL_SINGLE_COLOR);
+         glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, GL_FALSE);
+    }
+
     // redraw display
     fgRenderFrame();
 
@@ -1671,9 +1676,6 @@ bool fgMainInit( int argc, char **argv ) {
         exit(-1);
     }
 
-    SGPath modelpath( globals->get_fg_root() );
-    ssgModelPath( (char *)modelpath.c_str() );
-
     ////////////////////////////////////////////////////////////////////
     // Initialize the property-based built-in commands
     ////////////////////////////////////////////////////////////////////