]> git.mxchange.org Git - flightgear.git/commitdiff
Build only static libraries.
authorcurt <curt>
Fri, 12 Jun 1998 01:00:59 +0000 (01:00 +0000)
committercurt <curt>
Fri, 12 Jun 1998 01:00:59 +0000 (01:00 +0000)
Declare memmove/memset for Sloaris.
Added support for exponetial fog, which solves for the proper density to
achieve the desired visibility range.

Weather/Makefile.am
Weather/weather.c
Weather/weather.h

index b5973bdd4d66fc9a573d2603f5ce4ce898063c52..9690877f22bd3506b61fd70572b0740aa967f507 100644 (file)
@@ -1,7 +1,9 @@
-libdir = ${exec_prefix}/lib
+# libdir       = ${exec_prefix}/lib
+# lib_LTLIBRARIES = libWeather.la
+# libWeather_la_SOURCES = weather.c weather.h
 
-lib_LTLIBRARIES = libWeather.la
+noinst_LIBRARIES = libWeather.a
 
-libWeather_la_SOURCES = weather.c weather.h
+libWeather_a_SOURCES = weather.c weather.h
 
 INCLUDES += -I$(top_builddir) -I$(top_builddir)/Lib -I$(top_builddir)/Simulator
index 1cedc4fd0cb7c6ecd7edfe355384d6a6b30f40d8..079730ae978999986b7be84e81c52ceeb4fc122d 100644 (file)
  **************************************************************************/
 
 
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
+#ifdef HAVE_WINDOWS_H
+#  include <windows.h>                     
+#endif
+
+#include <GL/glut.h>
+#include <XGL/xgl.h>
+
+#include <math.h>
 #include <stdio.h>
 
-#include <Weather/weather.h>
 #include <Aircraft/aircraft.h>
+#include <Debug/fg_debug.h>
 #include <Math/fg_random.h>
+#include <Weather/weather.h>
 
 
 /* This is a record containing current weather info */
@@ -46,7 +59,7 @@ void fgWeatherInit( void ) {
     /* Configure some wind */
     /* FG_V_north_airmass = 15; */ /* ft/s =~ 10mph */
 
-    w->visibility = 45000.0;       /* in meters */
+    fgWeatherSetVisibility(45000.0);    /* in meters */
 }
 
 
@@ -70,10 +83,39 @@ void fgWeatherUpdate( void ) {
 }
 
 
+/* Get the current visibility */
+float fgWeatherGetVisibility( void ) {
+    struct fgWEATHER *w;
+    w = &current_weather;
+
+    return ( w->visibility );
+}
+
+
+/* Set the visibility and update fog parameters */
+void fgWeatherSetVisibility( float visibility ) {
+    struct fgWEATHER *w;
+    w = &current_weather;
+
+    w->visibility = visibility;       /* in meters */
+    // w->fog_density = -log(0.01 / w->visibility;        /* for GL_FOG_EXP */
+    w->fog_density = sqrt( -log(0.01) ) / w->visibility;  /* for GL_FOG_EXP2 */
+    xglFogf (GL_FOG_DENSITY, w->fog_density);
+    fgPrintf( FG_INPUT, FG_DEBUG, 
+             "Fog density = %.4f\n", w->fog_density);
+}
+
+
 /* $Log$
-/* Revision 1.15  1998/04/25 22:06:34  curt
-/* Edited cvs log messages in source files ... bad bad bad!
+/* Revision 1.16  1998/06/12 01:00:59  curt
+/* Build only static libraries.
+/* Declare memmove/memset for Sloaris.
+/* Added support for exponetial fog, which solves for the proper density to
+/* achieve the desired visibility range.
 /*
+ * Revision 1.15  1998/04/25 22:06:34  curt
+ * Edited cvs log messages in source files ... bad bad bad!
+ *
  * Revision 1.14  1998/02/09 15:07:54  curt
  * Minor tweaks.
  *
index 9a35efa1b42f888f5248797f411fc292aa4be08f..edc4d14162618c6d7cb1a0199ce4fe1e0b0d3aed 100644 (file)
@@ -36,6 +36,7 @@ extern "C" {
 /* holds the current weather values */
 struct fgWEATHER {
     float visibility;
+    float fog_density;
 };
 
 extern struct fgWEATHER current_weather;
@@ -49,6 +50,14 @@ void fgWeatherInit( void );
 void fgWeatherUpdate( void );
 
 
+/* Get the current visibility */
+float fgWeatherGetVisibility( void );
+
+
+/* Set the visibility and update fog parameters */
+void fgWeatherSetVisibility( float visibility );
+
+
 #ifdef __cplusplus
 }
 #endif
@@ -58,9 +67,15 @@ void fgWeatherUpdate( void );
 
 
 /* $Log$
-/* Revision 1.9  1998/04/21 17:02:46  curt
-/* Prepairing for C++ integration.
+/* Revision 1.10  1998/06/12 01:01:00  curt
+/* Build only static libraries.
+/* Declare memmove/memset for Sloaris.
+/* Added support for exponetial fog, which solves for the proper density to
+/* achieve the desired visibility range.
 /*
+ * Revision 1.9  1998/04/21 17:02:46  curt
+ * Prepairing for C++ integration.
+ *
  * Revision 1.8  1998/01/22 02:59:44  curt
  * Changed #ifdef FILE_H to #ifdef _FILE_H
  *