From: curt Date: Fri, 12 Jun 1998 01:00:59 +0000 (+0000) Subject: Build only static libraries. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=847f5b90d3262a05a6c706c6c38024f26277aab2;p=flightgear.git 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. --- diff --git a/Weather/Makefile.am b/Weather/Makefile.am index b5973bdd4..9690877f2 100644 --- a/Weather/Makefile.am +++ b/Weather/Makefile.am @@ -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 diff --git a/Weather/weather.c b/Weather/weather.c index 1cedc4fd0..079730ae9 100644 --- a/Weather/weather.c +++ b/Weather/weather.c @@ -24,11 +24,24 @@ **************************************************************************/ +#ifdef HAVE_CONFIG_H +# include +#endif + +#ifdef HAVE_WINDOWS_H +# include +#endif + +#include +#include + +#include #include -#include #include +#include #include +#include /* 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 = ¤t_weather; + + return ( w->visibility ); +} + + +/* Set the visibility and update fog parameters */ +void fgWeatherSetVisibility( float visibility ) { + struct fgWEATHER *w; + w = ¤t_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. * diff --git a/Weather/weather.h b/Weather/weather.h index 9a35efa1b..edc4d1416 100644 --- a/Weather/weather.h +++ b/Weather/weather.h @@ -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 *