Type-ified fgTIME and fgVIEW.
This commit is contained in:
parent
96525339ed
commit
5bbd08091c
5 changed files with 35 additions and 16 deletions
|
@ -54,12 +54,12 @@
|
||||||
#define RADHR(x) DEGHR(x*RAD_TO_DEG)
|
#define RADHR(x) DEGHR(x*RAD_TO_DEG)
|
||||||
|
|
||||||
|
|
||||||
struct fgTIME cur_time_params;
|
fgTIME cur_time_params;
|
||||||
|
|
||||||
|
|
||||||
// Initialize the time dependent variables
|
// Initialize the time dependent variables
|
||||||
|
|
||||||
void fgTimeInit(struct fgTIME *t) {
|
void fgTimeInit(fgTIME *t) {
|
||||||
fgOPTIONS *o;
|
fgOPTIONS *o;
|
||||||
|
|
||||||
o = ¤t_options;
|
o = ¤t_options;
|
||||||
|
@ -312,7 +312,7 @@ double sidereal_course(struct tm *gmt, time_t now, double lng) {
|
||||||
|
|
||||||
|
|
||||||
// Update time variables such as gmt, julian date, and sidereal time
|
// Update time variables such as gmt, julian date, and sidereal time
|
||||||
void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
|
void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) {
|
||||||
double gst_precise, gst_course;
|
double gst_precise, gst_course;
|
||||||
|
|
||||||
fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
|
fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
|
||||||
|
@ -375,6 +375,9 @@ void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 1998/04/28 01:22:16 curt
|
||||||
|
// Type-ified fgTIME and fgVIEW.
|
||||||
|
//
|
||||||
// Revision 1.3 1998/04/25 22:06:33 curt
|
// Revision 1.3 1998/04/25 22:06:33 curt
|
||||||
// Edited cvs log messages in source files ... bad bad bad!
|
// Edited cvs log messages in source files ... bad bad bad!
|
||||||
//
|
//
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
|
|
||||||
|
|
||||||
// Define a structure containing global time parameters
|
// Define a structure containing global time parameters
|
||||||
struct fgTIME {
|
typedef struct {
|
||||||
// the date/time in various forms
|
// the date/time in various forms
|
||||||
// Unix "calendar" time in seconds
|
// Unix "calendar" time in seconds
|
||||||
time_t cur_time;
|
time_t cur_time;
|
||||||
|
@ -80,9 +80,9 @@ struct fgTIME {
|
||||||
// How much to change the value of warp each iteration. Allows us
|
// How much to change the value of warp each iteration. Allows us
|
||||||
// to make time progress faster than normal.
|
// to make time progress faster than normal.
|
||||||
long int warp_delta;
|
long int warp_delta;
|
||||||
};
|
} fgTIME;
|
||||||
|
|
||||||
extern struct fgTIME cur_time_params;
|
extern fgTIME cur_time_params;
|
||||||
|
|
||||||
|
|
||||||
typedef struct fg_timestamp_t {
|
typedef struct fg_timestamp_t {
|
||||||
|
@ -104,17 +104,20 @@ void timesum(fg_timestamp *res, fg_timestamp *start, long millis);
|
||||||
|
|
||||||
|
|
||||||
// Update time variables such as gmt, julian date, and sidereal time
|
// Update time variables such as gmt, julian date, and sidereal time
|
||||||
void fgTimeInit(struct fgTIME *t);
|
void fgTimeInit(fgTIME *t);
|
||||||
|
|
||||||
|
|
||||||
// Update the time dependent variables
|
// Update the time dependent variables
|
||||||
void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t);
|
void fgTimeUpdate(fgFLIGHT *f, fgTIME *t);
|
||||||
|
|
||||||
|
|
||||||
#endif // _FG_TIME_HXX
|
#endif // _FG_TIME_HXX
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 1998/04/28 01:22:17 curt
|
||||||
|
// Type-ified fgTIME and fgVIEW.
|
||||||
|
//
|
||||||
// Revision 1.3 1998/04/25 22:06:34 curt
|
// Revision 1.3 1998/04/25 22:06:34 curt
|
||||||
// Edited cvs log messages in source files ... bad bad bad!
|
// Edited cvs log messages in source files ... bad bad bad!
|
||||||
//
|
//
|
||||||
|
|
|
@ -31,6 +31,10 @@
|
||||||
#include <signal.h> /* for timer routines */
|
#include <signal.h> /* for timer routines */
|
||||||
#include <stdio.h> /* for printf() */
|
#include <stdio.h> /* for printf() */
|
||||||
|
|
||||||
|
#ifdef HAVE_STDLIB_H
|
||||||
|
# include <stdlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef HAVE_SYS_TIME_H
|
||||||
# include <sys/time.h> /* for get/setitimer, gettimeofday, struct timeval */
|
# include <sys/time.h> /* for get/setitimer, gettimeofday, struct timeval */
|
||||||
#endif
|
#endif
|
||||||
|
@ -117,11 +121,14 @@ int fgGetTimeInterval( void ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.2 1998/04/25 20:24:03 curt
|
/* Revision 1.3 1998/04/28 01:22:18 curt
|
||||||
/* Cleaned up initialization sequence to eliminate interdependencies
|
/* Type-ified fgTIME and fgVIEW.
|
||||||
/* between sun position, lighting, and view position. This creates a
|
|
||||||
/* valid single pass initialization path.
|
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.2 1998/04/25 20:24:03 curt
|
||||||
|
* Cleaned up initialization sequence to eliminate interdependencies
|
||||||
|
* between sun position, lighting, and view position. This creates a
|
||||||
|
* valid single pass initialization path.
|
||||||
|
*
|
||||||
* Revision 1.1 1998/04/24 00:52:29 curt
|
* Revision 1.1 1998/04/24 00:52:29 curt
|
||||||
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
||||||
* Fog color fixes.
|
* Fog color fixes.
|
||||||
|
|
|
@ -95,8 +95,8 @@ void fgLightInit( void ) {
|
||||||
// update lighting parameters based on current sun position
|
// update lighting parameters based on current sun position
|
||||||
void fgLightUpdate( void ) {
|
void fgLightUpdate( void ) {
|
||||||
fgLIGHT *l;
|
fgLIGHT *l;
|
||||||
struct fgTIME *t;
|
fgTIME *t;
|
||||||
struct fgVIEW *v;
|
fgVIEW *v;
|
||||||
/* if the 4th field is 0.0, this specifies a direction ... */
|
/* if the 4th field is 0.0, this specifies a direction ... */
|
||||||
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
|
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
|
||||||
/* base sky color */
|
/* base sky color */
|
||||||
|
@ -158,6 +158,9 @@ void fgLightUpdate( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.4 1998/04/28 01:22:18 curt
|
||||||
|
// Type-ified fgTIME and fgVIEW.
|
||||||
|
//
|
||||||
// Revision 1.3 1998/04/26 05:10:04 curt
|
// Revision 1.3 1998/04/26 05:10:04 curt
|
||||||
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
||||||
//
|
//
|
||||||
|
|
|
@ -273,8 +273,8 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) {
|
||||||
// update the cur_time_params structure with the current sun position
|
// update the cur_time_params structure with the current sun position
|
||||||
void fgUpdateSunPos( void ) {
|
void fgUpdateSunPos( void ) {
|
||||||
fgLIGHT *l;
|
fgLIGHT *l;
|
||||||
struct fgTIME *t;
|
fgTIME *t;
|
||||||
struct fgVIEW *v;
|
fgVIEW *v;
|
||||||
MAT3vec nup, nsun, v0;
|
MAT3vec nup, nsun, v0;
|
||||||
double sun_gd_lat, sl_radius;
|
double sun_gd_lat, sl_radius;
|
||||||
double ntmp;
|
double ntmp;
|
||||||
|
@ -346,6 +346,9 @@ void fgUpdateSunPos( void ) {
|
||||||
|
|
||||||
|
|
||||||
// $Log$
|
// $Log$
|
||||||
|
// Revision 1.6 1998/04/28 01:22:18 curt
|
||||||
|
// Type-ified fgTIME and fgVIEW.
|
||||||
|
//
|
||||||
// Revision 1.5 1998/04/26 05:10:05 curt
|
// Revision 1.5 1998/04/26 05:10:05 curt
|
||||||
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in a new issue