From: curt Date: Thu, 26 Apr 2001 18:15:32 +0000 (+0000) Subject: Timezone fixes for Cygwin. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c7f7093df5d76bfcbe14ca5dd84ef54c884e0082;p=flightgear.git Timezone fixes for Cygwin. --- diff --git a/src/Main/main.cxx b/src/Main/main.cxx index 1eb0ae685..dacc1abd5 100644 --- a/src/Main/main.cxx +++ b/src/Main/main.cxx @@ -1538,14 +1538,14 @@ int main( int argc, char **argv ) { globals->get_ephem()->getStars(), 60000.0 ); if ( fgGetBool("/environment/clouds/status") ) { + thesky->add_cloud_layer( 2000.0, 200.0, 50.0, 40000.0, + SG_CLOUD_OVERCAST ); thesky->add_cloud_layer( 2600.0, 200.0, 50.0, 40000.0, + SG_CLOUD_MOSTLY_CLOUDY ); + thesky->add_cloud_layer( 3000.0, 200.0, 50.0, 40000.0, SG_CLOUD_MOSTLY_SUNNY ); thesky->add_cloud_layer( 6000.0, 20.0, 10.0, 40000.0, SG_CLOUD_CIRRUS ); - // thesky->add_cloud_layer( 1000.0, 200.0, 50.0, - // SG_CLOUD_MOSTLY_SUNNY ); - // thesky->add_cloud_layer( 1800.0, 400.0, 100.0, SG_CLOUD_OVERCAST ); - // thesky->add_cloud_layer( 5000.0, 20.0, 10.0, SG_CLOUD_CIRRUS ); } // Initialize MagVar model diff --git a/src/Main/viewer.cxx b/src/Main/viewer.cxx index 070228789..85204ad5d 100644 --- a/src/Main/viewer.cxx +++ b/src/Main/viewer.cxx @@ -35,7 +35,9 @@ // Constructor FGViewer::FGViewer( void ): -fov(55.0) + fov(55.0), + view_offset(0.0), + goal_view_offset(0.0) { } diff --git a/tests/test-mktime.cxx b/tests/test-mktime.cxx index 294c00d0d..6c6734d51 100644 --- a/tests/test-mktime.cxx +++ b/tests/test-mktime.cxx @@ -75,21 +75,27 @@ time_t get_start_gmt(int year) { #else // ! defined ( MK_TIME_IS_GMT ) // timezone seems to work as a proper offset for Linux & Solaris -# if defined( __linux__ ) || defined( __sun__ ) +# if defined( __linux__ ) || defined( __sun__ ) || defined( __CYGWIN__ ) # define TIMEZONE_OFFSET_WORKS 1 # endif +#if defined(__CYGWIN__) +#define TIMEZONE _timezone +#else +#define TIMEZONE timezone +#endif + time_t start = mktime(&mt); printf("start1 = %ld\n", start); printf("start2 = %s", ctime(&start)); printf("(tm_isdst = %d)\n", mt.tm_isdst); - timezone = fix_up_timezone( timezone ); - + TIMEZONE = fix_up_timezone( TIMEZONE ); + # if defined( TIMEZONE_OFFSET_WORKS ) - printf("start = %ld, timezone = %ld\n", start, timezone); - return( start - timezone ); + printf("start = %ld, timezone = %ld\n", start, TIMEZONE); + return( start - TIMEZONE ); # else // ! defined( TIMEZONE_OFFSET_WORKS ) daylight = mt.tm_isdst; @@ -99,13 +105,13 @@ time_t get_start_gmt(int year) { printf("OOOPS, problem in fg_time.cxx, no daylight savings info.\n"); } - long int offset = -(timezone / 3600 - daylight); + long int offset = -(TIMEZONE / 3600 - daylight); - printf(" Raw time zone offset = %ld\n", timezone); + printf(" Raw time zone offset = %ld\n", TIMEZONE); printf(" Daylight Savings = %d\n", daylight); printf(" Local hours from GMT = %ld\n", offset); - long int start_gmt = start - timezone + (daylight * 3600); + long int start_gmt = start - TIMEZONE + (daylight * 3600); printf(" March 21 noon (CST) = %ld\n", start);