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)
|
||||
|
||||
|
||||
struct fgTIME cur_time_params;
|
||||
fgTIME cur_time_params;
|
||||
|
||||
|
||||
// Initialize the time dependent variables
|
||||
|
||||
void fgTimeInit(struct fgTIME *t) {
|
||||
void fgTimeInit(fgTIME *t) {
|
||||
fgOPTIONS *o;
|
||||
|
||||
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
|
||||
void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
|
||||
void fgTimeUpdate(fgFLIGHT *f, fgTIME *t) {
|
||||
double gst_precise, gst_course;
|
||||
|
||||
fgPrintf( FG_EVENT, FG_BULK, "Updating time\n");
|
||||
|
@ -375,6 +375,9 @@ void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t) {
|
|||
|
||||
|
||||
// $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
|
||||
// Edited cvs log messages in source files ... bad bad bad!
|
||||
//
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
|
||||
|
||||
// Define a structure containing global time parameters
|
||||
struct fgTIME {
|
||||
typedef struct {
|
||||
// the date/time in various forms
|
||||
// Unix "calendar" time in seconds
|
||||
time_t cur_time;
|
||||
|
@ -80,9 +80,9 @@ struct fgTIME {
|
|||
// How much to change the value of warp each iteration. Allows us
|
||||
// to make time progress faster than normal.
|
||||
long int warp_delta;
|
||||
};
|
||||
} fgTIME;
|
||||
|
||||
extern struct fgTIME cur_time_params;
|
||||
extern fgTIME cur_time_params;
|
||||
|
||||
|
||||
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
|
||||
void fgTimeInit(struct fgTIME *t);
|
||||
void fgTimeInit(fgTIME *t);
|
||||
|
||||
|
||||
// Update the time dependent variables
|
||||
void fgTimeUpdate(fgFLIGHT *f, struct fgTIME *t);
|
||||
void fgTimeUpdate(fgFLIGHT *f, fgTIME *t);
|
||||
|
||||
|
||||
#endif // _FG_TIME_HXX
|
||||
|
||||
|
||||
// $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
|
||||
// Edited cvs log messages in source files ... bad bad bad!
|
||||
//
|
||||
|
|
|
@ -31,6 +31,10 @@
|
|||
#include <signal.h> /* for timer routines */
|
||||
#include <stdio.h> /* for printf() */
|
||||
|
||||
#ifdef HAVE_STDLIB_H
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
# include <sys/time.h> /* for get/setitimer, gettimeofday, struct timeval */
|
||||
#endif
|
||||
|
@ -117,11 +121,14 @@ int fgGetTimeInterval( void ) {
|
|||
|
||||
|
||||
/* $Log$
|
||||
/* 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.3 1998/04/28 01:22:18 curt
|
||||
/* Type-ified fgTIME and fgVIEW.
|
||||
/*
|
||||
* 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
|
||||
* Wrapped "#include <config.h>" in "#ifdef HAVE_CONFIG_H"
|
||||
* Fog color fixes.
|
||||
|
|
|
@ -95,8 +95,8 @@ void fgLightInit( void ) {
|
|||
// update lighting parameters based on current sun position
|
||||
void fgLightUpdate( void ) {
|
||||
fgLIGHT *l;
|
||||
struct fgTIME *t;
|
||||
struct fgVIEW *v;
|
||||
fgTIME *t;
|
||||
fgVIEW *v;
|
||||
/* if the 4th field is 0.0, this specifies a direction ... */
|
||||
GLfloat white[4] = { 1.0, 1.0, 1.0, 1.0 };
|
||||
/* base sky color */
|
||||
|
@ -158,6 +158,9 @@ void fgLightUpdate( void ) {
|
|||
|
||||
|
||||
// $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
|
||||
// "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
|
||||
void fgUpdateSunPos( void ) {
|
||||
fgLIGHT *l;
|
||||
struct fgTIME *t;
|
||||
struct fgVIEW *v;
|
||||
fgTIME *t;
|
||||
fgVIEW *v;
|
||||
MAT3vec nup, nsun, v0;
|
||||
double sun_gd_lat, sl_radius;
|
||||
double ntmp;
|
||||
|
@ -346,6 +346,9 @@ void fgUpdateSunPos( void ) {
|
|||
|
||||
|
||||
// $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
|
||||
// "struct fgLIGHT" -> "fgLIGHT" because fgLIGHT is typedef'd.
|
||||
//
|
||||
|
|
Loading…
Reference in a new issue