]> git.mxchange.org Git - flightgear.git/blobdiff - src/Time/light.cxx
First quick hack at panel shading.
[flightgear.git] / src / Time / light.cxx
index 401fd2a3d4fa113b827e39c56b1a0380abac9369..b7c4a6b819f91e90b0336a923777c43041f7f3d3 100644 (file)
@@ -31,9 +31,9 @@
 #endif
 
 #include <GL/glut.h>
-#include <XGL/xgl.h>
+#include <simgear/xgl/xgl.h>
 
-#include "Include/compiler.h"
+#include <simgear/compiler.h>
 
 #ifdef FG_MATH_EXCEPTION_CLASH
 #  define exception c_exception
 #include <string>
 FG_USING_STD(string);
 
+#include <simgear/constants.h>
+#include <simgear/debug/logstream.hxx>
+#include <simgear/math/fg_geodesy.hxx>
+#include <simgear/math/interpolater.hxx>
+#include <simgear/math/polar3d.hxx>
+#include <simgear/misc/fgpath.hxx>
+
 #include <Aircraft/aircraft.hxx>
-#include <Debug/logstream.hxx>
-#include <Include/fg_constants.h>
 #include <Main/options.hxx>
 #include <Main/views.hxx>
-#include <Math/fg_geodesy.hxx>
-#include <Math/interpolater.hxx>
-#include <Math/mat3.h>
-#include <Math/polar3d.hxx>
-#include <Misc/fgpath.hxx>
 
 #include "fg_time.hxx"
 #include "light.hxx"
@@ -117,7 +117,7 @@ void fgLIGHT::Update( void ) {
     // calculate lighting parameters based on sun's relative angle to
     // local up
 
-    deg = sun_angle * 180.0 / FG_PI;
+    deg = sun_angle * RAD_TO_DEG;
     FG_LOG( FG_EVENT, FG_INFO, "  Sun angle = " << deg );
 
     ambient = ambient_tbl->interpolate( deg );
@@ -137,10 +137,12 @@ void fgLIGHT::Update( void ) {
     scene_ambient[0] = white[0] * ambient;
     scene_ambient[1] = white[1] * ambient;
     scene_ambient[2] = white[2] * ambient;
+    scene_ambient[3] = 1.0;
 
     scene_diffuse[0] = white[0] * diffuse;
     scene_diffuse[1] = white[1] * diffuse;
     scene_diffuse[2] = white[2] * diffuse;
+    scene_diffuse[3] = 1.0;
 
     // set sky color
     sky_color[0] = base_sky_color[0] * sky_brightness;