]> git.mxchange.org Git - flightgear.git/commitdiff
Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
authorcurt <curt>
Fri, 24 Apr 1998 00:45:00 +0000 (00:45 +0000)
committercurt <curt>
Fri, 24 Apr 1998 00:45:00 +0000 (00:45 +0000)
Fixed a bug when generating sky colors.

Astro/moon.cxx
Astro/moon.hxx
Astro/orbits.cxx
Astro/orbits.hxx
Astro/planets.cxx
Astro/sky.cxx
Astro/stars.cxx
Astro/sun.cxx

index 53dda6d532c17da4738bec14f6b8459d75c3c5a3..3aed3ed21755a69ba26122513a1a68afc0d4e1dc 100644 (file)
@@ -21,7 +21,9 @@
  **************************************************************************/
 
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #ifdef HAVE_WINDOWS_H
 #  include <windows.h>
@@ -36,7 +38,7 @@
 #include <Include/fg_constants.h>
 #include <Include/general.h>
 #include <Main/views.hxx>
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 
 #include "orbits.hxx"
 #include "moon.hxx"
@@ -214,9 +216,13 @@ void fgMoonRender( void ) {
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:28  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:00  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:28  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.9  1998/04/18 04:13:56  curt
  * Moved fg_debug.c to it's own library.
  *
index c1838004219e38109ef4d6fe7aa5993d6b577dd8..22e665a584dc892206f73467228b3ebc486d90ee 100644 (file)
@@ -33,7 +33,7 @@
 
 #include <math.h>
 
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 
 #include "orbits.hxx"
 
@@ -55,9 +55,13 @@ extern struct OrbElements pltOrbElements[9];
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:28  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:00  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:28  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.7  1998/04/21 17:02:30  curt
  * Prepairing for C++ integration.
  *
index 40ff471fa717a02155aec9ad6d880b02386344ff..92e3ef4c440381cafc7c97c4218ba194c62e7466 100644 (file)
@@ -23,7 +23,9 @@
  **************************************************************************/
 
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #include <math.h>
 #include <string.h>
@@ -31,7 +33,7 @@
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Include/general.h>
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 
 #include "orbits.hxx"
 
@@ -168,9 +170,13 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:29  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:01  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:29  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.10  1998/04/18 04:13:57  curt
  * Moved fg_debug.c to it's own library.
  *
index a468fcb66f0dedbf3db5e2bbc2cc0d97ab5fd4f4..d0cd4a9824f65d980d424109ca2491ad482ae1f5 100644 (file)
@@ -35,7 +35,7 @@
 #include <stdio.h>
 #include <math.h>
 
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 
 
 
@@ -88,9 +88,13 @@ void fgSolarSystemUpdate(struct OrbElements *planets, struct fgTIME t);
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:30  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:01  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:30  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.7  1998/04/21 17:02:31  curt
  * Prepairing for C++ integration.
  *
index 2d90d99f727c813bd302a25860aa7c11b1e78f08..7b4351639b439c656b85fab195a946838ea086ad 100644 (file)
@@ -23,7 +23,9 @@
  **************************************************************************/
 
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #ifdef HAVE_WINDOWS_H
 #  include <windows.h>
@@ -34,7 +36,7 @@
 
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 #include <Time/light.hxx>
 
 #include "orbits.hxx"
@@ -208,9 +210,13 @@ void fgPlanetsRender( void ) {
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:31  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:02  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:31  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.9  1998/04/18 04:13:57  curt
  * Moved fg_debug.c to it's own library.
  *
index df6c640d3021933b21b4db67632ef6a75cdc83f9..91f917a462d2ec9157d0086dd3592a1837e2540e 100644 (file)
@@ -24,7 +24,9 @@
  **************************************************************************/
 
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #ifdef HAVE_WINDOWS_H
 #  include <windows.h>
 #include <XGL/xgl.h>
 
 #include <Aircraft/aircraft.h>
+#include <Debug/fg_debug.h>
 #include <Flight/flight.h>
 #include <Include/fg_constants.h>
 #include <Main/views.hxx>
 #include <Math/fg_random.h>
-#include <Time/event.h>
-#include <Time/fg_time.h>
+#include <Time/event.hxx>
+#include <Time/fg_time.hxx>
 
 #include "sky.hxx"
 
@@ -81,7 +84,7 @@ void fgSkyVerticesInit( void ) {
     float theta;
     int i;
 
-    printf("  Generating the sky dome vertices.\n");
+    fgPrintf(FG_ASTRO, FG_INFO, "  Generating the sky dome vertices.\n");
 
     for ( i = 0; i < 12; i++ ) {
        theta = (i * 30.0) * DEG_TO_RAD;
@@ -118,11 +121,12 @@ void fgSkyColorsInit( void ) {
 
     l = &cur_light_params;
 
-    printf("  Generating the sky colors for each vertex.\n");
+    fgPrintf( FG_ASTRO, FG_INFO, 
+             "  Generating the sky colors for each vertex.\n" );
 
     /* setup for the possibility of sunset effects */
     sun_angle = l->sun_angle * RAD_TO_DEG;
-    printf("  Sun angle in degrees = %.2f\n", sun_angle);
+    fgPrintf( FG_ASTRO, FG_INFO, "  Sun angle in degrees = %.2f\n", sun_angle);
 
     if ( (sun_angle > 80.0) && (sun_angle < 100.0) ) {
        /* 0.0 - 0.4 */
@@ -161,10 +165,15 @@ void fgSkyColorsInit( void ) {
        for ( j = 0; j < 3; j++ ) {
            diff = l->sky_color[j] - l->fog_color[j];
 
+           /* printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
+                  l->sky_color[j], l->fog_color[j], diff); */
+
            inner_color[i][j] = l->sky_color[j] - diff * 0.3;
            middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
            outer_color[i][j] = l->fog_color[j] + outer_amt[j];
 
+           if ( inner_color[i][j] > 1.00 ) { inner_color[i][j] = 1.00; }
+           if ( inner_color[i][j] < 0.10 ) { inner_color[i][j] = 0.10; }
            if ( middle_color[i][j] > 1.00 ) { middle_color[i][j] = 1.00; }
            if ( middle_color[i][j] < 0.10 ) { middle_color[i][j] = 0.10; }
            if ( outer_color[i][j] > 1.00 ) { outer_color[i][j] = 1.00; }
@@ -200,10 +209,15 @@ void fgSkyColorsInit( void ) {
        for ( j = 0; j < 3; j++ ) {
            diff = l->sky_color[j] - l->fog_color[j];
 
+           /* printf("sky = %.2f  fog = %.2f  diff = %.2f\n", 
+                  l->sky_color[j], l->fog_color[j], diff); */
+
            inner_color[i][j] = l->sky_color[j] - diff * 0.3;
            middle_color[i][j] = l->sky_color[j] - diff * 0.9 + middle_amt[j];
            outer_color[i][j] = l->fog_color[j] + outer_amt[j];
 
+           if ( inner_color[i][j] > 1.00 ) { inner_color[i][j] = 1.00; }
+           if ( inner_color[i][j] < 0.10 ) { inner_color[i][j] = 0.10; }
            if ( middle_color[i][j] > 1.00 ) { middle_color[i][j] = 1.00; }
            if ( middle_color[i][j] < 0.10 ) { middle_color[i][j] = 0.10; }
            if ( outer_color[i][j] > 1.00 ) { outer_color[i][j] = 1.00; }
@@ -233,7 +247,7 @@ void fgSkyColorsInit( void ) {
 
 /* Initialize the sky structure and colors */
 void fgSkyInit( void ) {
-    printf("Initializing the sky\n");
+    fgPrintf(FG_ASTRO, FG_INFO, "Initializing the sky\n");
 
     fgSkyVerticesInit();
 
@@ -275,7 +289,7 @@ void fgSkyRender( void ) {
     } else {
        angle = -acos(dot);
     }
-    /*printf("  Sky needs to rotate = %.3f rads = %.1f degrees.\n", 
+    /* printf("  Sky needs to rotate = %.3f rads = %.1f degrees.\n", 
           angle, angle * RAD_TO_DEG); */
 
     /* Translate to view position */
@@ -302,19 +316,27 @@ void fgSkyRender( void ) {
     xglVertex3fv( inner_vertex[0] );
     xglEnd();
 
-    /* Draw the middle ring */
+    // Draw the middle ring
     xglBegin( GL_TRIANGLE_STRIP );
     for ( i = 0; i < 12; i++ ) {
        xglColor4fv( middle_color[i] );
+       /* printf("middle_color[%d] = %.2f %.2f %.2f %.2f\n", i, 
+              middle_color[i][0], middle_color[i][1], middle_color[i][2], 
+              middle_color[i][3]); */
+       // xglColor4f(1.0, 0.0, 0.0, 1.0);
        xglVertex3fv( middle_vertex[i] );
        xglColor4fv( inner_color[i] );
+       /* printf("inner_color[%d] = %.2f %.2f %.2f %.2f\n", i, 
+              inner_color[i][0], inner_color[i][1], inner_color[i][2], 
+              inner_color[i][3]); */
+       // xglColor4f(0.0, 0.0, 1.0, 1.0);
        xglVertex3fv( inner_vertex[i] );
     }
     xglColor4fv( middle_color[0] );
-    /* xglColor4f(1.0, 0.0, 0.0, 1.0); */
+    // xglColor4f(1.0, 0.0, 0.0, 1.0);
     xglVertex3fv( middle_vertex[0] );
     xglColor4fv( inner_color[0] );
-    /* xglColor4f(1.0, 0.0, 0.0, 1.0); */
+    // xglColor4f(0.0, 0.0, 1.0, 1.0);
     xglVertex3fv( inner_vertex[0] );
     xglEnd();
 
@@ -351,9 +373,13 @@ void fgSkyRender( void ) {
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:32  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:03  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:32  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.9  1998/04/03 21:52:50  curt
  * Converting to Gnu autoconf system.
  *
index d163923c0f593ab22914de2991edd92eb00616b8..d413b802bcfcea4d2bf564d4d0beb0701ad684ac 100644 (file)
@@ -24,7 +24,9 @@
  **************************************************************************/
 
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
 
 #ifdef HAVE_WINDOWS_H
 #  include <windows.h>
@@ -43,7 +45,7 @@
 #include <Include/fg_constants.h>
 #include <Include/general.h>
 #include <Main/views.hxx>
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 
 #include "orbits.hxx"
 #include "planets.hxx"
@@ -258,9 +260,13 @@ void fgStarsRender( void ) {
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:34  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:03  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:34  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.11  1998/04/18 04:13:58  curt
  * Moved fg_debug.c to it's own library.
  *
index 039953d9de8a205bdf658ee98f0edc67c8c9d8d8..7941596d6e62f60ea76276cd97b8be4136b10282 100644 (file)
@@ -23,7 +23,9 @@
  **************************************************************************/
 
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
  
 #ifdef HAVE_WINDOWS_H                                           
 #  include <windows.h>                                           
@@ -35,7 +37,7 @@
 #include <Debug/fg_debug.h>
 #include <Include/fg_constants.h>
 #include <Main/views.hxx>
-#include <Time/fg_time.h>
+#include <Time/fg_time.hxx>
 #include <Time/sunpos.hxx>
 
 #include "orbits.hxx"
@@ -190,9 +192,13 @@ void fgSunRender( void ) {
 
 
 /* $Log$
-/* Revision 1.1  1998/04/22 13:21:36  curt
-/* C++ - ifing the code a bit.
+/* Revision 1.2  1998/04/24 00:45:04  curt
+/* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
+/* Fixed a bug when generating sky colors.
 /*
+ * Revision 1.1  1998/04/22 13:21:36  curt
+ * C++ - ifing the code a bit.
+ *
  * Revision 1.10  1998/04/18 04:13:58  curt
  * Moved fg_debug.c to it's own library.
  *