]> git.mxchange.org Git - flightgear.git/blobdiff - src/Main/main.cxx
Frederic Bouvier:
[flightgear.git] / src / Main / main.cxx
index 7d0026bce9f385e58967a0fbf6aa737c4834d84f..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>
@@ -343,7 +341,7 @@ void trRenderFrame( void ) {
 
     // we need a white diffuse light for the phase of the moon
     ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, white );
-    thesky->preDraw();
+    thesky->preDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER );
 
     // draw the ssg scene
     // return to the desired diffuse color
@@ -678,7 +676,7 @@ void fgRenderFrame() {
             // we need a white diffuse light for the phase of the moon
             ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, white );
 
-            thesky->preDraw();
+            thesky->preDraw( cur_fdm_state->get_Altitude() * SG_FEET_TO_METER );
 
             // return to the desired diffuse color
             ssgGetLight( 0 ) -> setColour( GL_DIFFUSE, l->scene_diffuse );
@@ -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
     ////////////////////////////////////////////////////////////////////