Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
system and commandline/config file processing code.
This commit is contained in:
20
Astro/moon.c
20
Astro/moon.c
@@ -29,10 +29,11 @@
|
||||
#include <Astro/moon.h>
|
||||
|
||||
#include <Aircraft/aircraft.h>
|
||||
#include <Include/constants.h>
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Include/general.h>
|
||||
#include <Main/views.h>
|
||||
#include <Time/fg_time.h>
|
||||
#include <Main/fg_debug.h>
|
||||
|
||||
struct CelestialCoord moonPos;
|
||||
|
||||
@@ -261,7 +262,7 @@ void fgMoonInit( void ) {
|
||||
struct fgLIGHT *l;
|
||||
static int dl_exists = 0;
|
||||
|
||||
printf("Initializing the Moon\n");
|
||||
fgPrintf( FG_ASTRO, FG_INFO, "Initializing the Moon\n");
|
||||
|
||||
l = &cur_light_params;
|
||||
|
||||
@@ -270,8 +271,9 @@ void fgMoonInit( void ) {
|
||||
moonPos = fgCalculateMoon(pltOrbElements[1], pltOrbElements[0],
|
||||
cur_time_params);
|
||||
#ifdef DEBUG
|
||||
printf("Moon found at %f (ra), %f (dec)\n", moonPos.RightAscension,
|
||||
moonPos.Declination);
|
||||
fgPrintf( FG_ASTRO, FG_DEBUG,
|
||||
"Moon found at %f (ra), %f (dec)\n", moonPos.RightAscension,
|
||||
moonPos.Declination);
|
||||
#endif
|
||||
|
||||
xMoon = 60000.0 * cos(moonPos.RightAscension) * cos(moonPos.Declination);
|
||||
@@ -320,10 +322,14 @@ void fgMoonRender( void ) {
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.3 1998/01/19 19:26:57 curt
|
||||
/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
/* This should simplify things tremendously.
|
||||
/* Revision 1.4 1998/01/27 00:47:46 curt
|
||||
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
|
||||
/* system and commandline/config file processing code.
|
||||
/*
|
||||
* Revision 1.3 1998/01/19 19:26:57 curt
|
||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
* This should simplify things tremendously.
|
||||
*
|
||||
* Revision 1.2 1998/01/19 18:40:16 curt
|
||||
* Tons of little changes to clean up the code and to remove fatal errors
|
||||
* when building with the c++ compiler.
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
#include <Include/general.h>
|
||||
#include <Time/fg_time.h>
|
||||
|
||||
#include <Main/fg_debug.h>
|
||||
|
||||
struct OrbElements pltOrbElements[9];
|
||||
|
||||
@@ -126,7 +126,7 @@ void fgSolarSystemInit(struct fgTIME t)
|
||||
int i;
|
||||
FILE *data;
|
||||
|
||||
printf("Initializing solar system\n");
|
||||
fgPrintf( FG_ASTRO, FG_INFO, "Initializing solar system\n");
|
||||
|
||||
/* build the full path name to the orbital elements database file */
|
||||
g = &general;
|
||||
@@ -137,11 +137,11 @@ void fgSolarSystemInit(struct fgTIME t)
|
||||
|
||||
if ( (data = fopen(path, "r")) == NULL )
|
||||
{
|
||||
printf("Cannot open data file: '%s'\n", path);
|
||||
fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open data file: '%s'\n", path);
|
||||
return;
|
||||
}
|
||||
#ifdef DEBUG
|
||||
printf(" reading datafile %s\n", path);
|
||||
fgPrintf( FG_ASTRO, FG_INFO, " reading datafile %s\n", path);
|
||||
#endif
|
||||
|
||||
/* for all the objects... */
|
||||
@@ -174,9 +174,13 @@ void fgSolarSystemUpdate(struct OrbElements *planet, struct fgTIME t)
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.3 1998/01/22 02:59:27 curt
|
||||
/* Changed #ifdef FILE_H to #ifdef _FILE_H
|
||||
/* Revision 1.4 1998/01/27 00:47:47 curt
|
||||
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
|
||||
/* system and commandline/config file processing code.
|
||||
/*
|
||||
* Revision 1.3 1998/01/22 02:59:27 curt
|
||||
* Changed #ifdef FILE_H to #ifdef _FILE_H
|
||||
*
|
||||
* Revision 1.2 1998/01/19 19:26:58 curt
|
||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
* This should simplify things tremendously.
|
||||
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <Astro/orbits.h>
|
||||
#include <Astro/planets.h>
|
||||
#include <Astro/sun.h>
|
||||
|
||||
#include <Main/fg_debug.h>
|
||||
|
||||
struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
|
||||
struct OrbElements theSun,
|
||||
@@ -118,25 +118,31 @@ struct CelestialCoord fgCalculatePlanet(struct OrbElements planet,
|
||||
result.magnitude = -6.90 + 5*log10 (r*R) + 0.001 *FV;
|
||||
break;
|
||||
default:
|
||||
printf("index %d out of range !!!!\n", idx);
|
||||
fgPrintf( FG_ASTRO, FG_ALERT, "index %d out of range !!!!\n", idx);
|
||||
}
|
||||
printf(" Planet found at %f (ra), %f (dec)\n",
|
||||
result.RightAscension, result.Declination);
|
||||
printf(" Geocentric dist %f\n"
|
||||
" Heliocentric dist %f\n"
|
||||
" Distance to the sun %f\n"
|
||||
" Phase angle %f\n"
|
||||
" Brightness %f\n", R, r, s, FV, result.magnitude);
|
||||
fgPrintf( FG_ASTRO, FG_DEBUG,
|
||||
" Planet found at %f (ra), %f (dec)\n",
|
||||
result.RightAscension, result.Declination);
|
||||
fgPrintf( FG_ASTRO, FG_DEBUG,
|
||||
" Geocentric dist %f\n"
|
||||
" Heliocentric dist %f\n"
|
||||
" Distance to the sun %f\n"
|
||||
" Phase angle %f\n"
|
||||
" Brightness %f\n", R, r, s, FV, result.magnitude);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.2 1998/01/19 19:26:59 curt
|
||||
/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
/* This should simplify things tremendously.
|
||||
/* Revision 1.3 1998/01/27 00:47:47 curt
|
||||
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
|
||||
/* system and commandline/config file processing code.
|
||||
/*
|
||||
* Revision 1.2 1998/01/19 19:26:59 curt
|
||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
* This should simplify things tremendously.
|
||||
*
|
||||
* Revision 1.1 1998/01/07 03:16:18 curt
|
||||
* Moved from .../Src/Scenery/ to .../Src/Astro/
|
||||
*
|
||||
|
||||
12
Astro/sky.c
12
Astro/sky.c
@@ -45,7 +45,7 @@
|
||||
|
||||
#include <Aircraft/aircraft.h>
|
||||
#include <Flight/flight.h>
|
||||
#include <Include/constants.h>
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Main/views.h>
|
||||
#include <Math/fg_random.h>
|
||||
|
||||
@@ -353,10 +353,14 @@ void fgSkyRender( void ) {
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.4 1998/01/26 15:54:28 curt
|
||||
/* Added a "skirt" to try to help hide gaps between scenery and sky. This will
|
||||
/* have to be revisited in the future.
|
||||
/* Revision 1.5 1998/01/27 00:47:48 curt
|
||||
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
|
||||
/* system and commandline/config file processing code.
|
||||
/*
|
||||
* Revision 1.4 1998/01/26 15:54:28 curt
|
||||
* Added a "skirt" to try to help hide gaps between scenery and sky. This will
|
||||
* have to be revisited in the future.
|
||||
*
|
||||
* Revision 1.3 1998/01/19 19:26:59 curt
|
||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
* This should simplify things tremendously.
|
||||
|
||||
@@ -40,12 +40,12 @@
|
||||
#include <Astro/planets.h>
|
||||
#include <Astro/stars.h>
|
||||
|
||||
#include <Include/constants.h>
|
||||
#include <Include/fg_constants.h>
|
||||
#include <Include/general.h>
|
||||
#include <Aircraft/aircraft.h>
|
||||
#include <Main/views.h>
|
||||
#include <Time/fg_time.h>
|
||||
|
||||
#include <Main/fg_debug.h>
|
||||
|
||||
#define EpochStart (631065600)
|
||||
#define DaysSinceEpoch(secs) (((secs)-EpochStart)*(1.0/(24*3600)))
|
||||
@@ -68,7 +68,7 @@ void fgStarsInit( void ) {
|
||||
double ra_save1, decl_save1;
|
||||
int count, i, j, max_stars;
|
||||
|
||||
printf("Initializing stars\n");
|
||||
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n");
|
||||
|
||||
g = &general;
|
||||
|
||||
@@ -81,10 +81,10 @@ void fgStarsInit( void ) {
|
||||
max_stars = FG_MAX_STARS;
|
||||
|
||||
for ( i = 0; i < FG_STAR_LEVELS; i++ ) {
|
||||
printf(" Loading %d Stars: %s\n", max_stars, path);
|
||||
fgPrintf( FG_ASTRO, FG_INFO, " Loading %d Stars: %s\n", max_stars, path);
|
||||
|
||||
if ( (fd = fopen(path, "r")) == NULL ) {
|
||||
printf("Cannot open star file: '%s'\n", path);
|
||||
fgPrintf( FG_ASTRO, FG_ALERT, "Cannot open star file: '%s'\n", path);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -276,10 +276,14 @@ void fgStarsRender( void ) {
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.3 1998/01/19 19:26:59 curt
|
||||
/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
/* This should simplify things tremendously.
|
||||
/* Revision 1.4 1998/01/27 00:47:49 curt
|
||||
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
|
||||
/* system and commandline/config file processing code.
|
||||
/*
|
||||
* Revision 1.3 1998/01/19 19:26:59 curt
|
||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
* This should simplify things tremendously.
|
||||
*
|
||||
* Revision 1.2 1998/01/19 18:40:18 curt
|
||||
* Tons of little changes to clean up the code and to remove fatal errors
|
||||
* when building with the c++ compiler.
|
||||
|
||||
25
Astro/sun.c
25
Astro/sun.c
@@ -29,6 +29,7 @@
|
||||
#include <Main/views.h>
|
||||
#include <Astro/orbits.h>
|
||||
#include <Astro/sun.h>
|
||||
#include <Main/fg_debug.h>
|
||||
|
||||
GLint sun_obj;
|
||||
|
||||
@@ -97,13 +98,14 @@ struct CelestialCoord fgCalculateSun(struct OrbElements params, struct fgTIME t)
|
||||
void fgSunInit( void ) {
|
||||
static int dl_exists = 0;
|
||||
|
||||
printf(" Initializing the Sun\n");
|
||||
fgPrintf( FG_ASTRO, FG_INFO, " Initializing the Sun\n");
|
||||
|
||||
fgSolarSystemUpdate(&(pltOrbElements[0]), cur_time_params);
|
||||
sunPos = fgCalculateSun(pltOrbElements[0], cur_time_params);
|
||||
#ifdef DEBUG
|
||||
printf("Sun found at %f (ra), %f (dec)\n", sunPos.RightAscension,
|
||||
sunPos.Declination);
|
||||
fgPrintf( FG_ASTRO, FG_INFO,
|
||||
"Sun found at %f (ra), %f (dec)\n",
|
||||
sunPos.RightAscension, sunPos.Declination);
|
||||
#endif
|
||||
|
||||
xSun = 60000.0 * cos(sunPos.RightAscension) * cos(sunPos.Declination);
|
||||
@@ -155,9 +157,10 @@ void fgSunRender( void ) {
|
||||
amb[2] = 0.00 + ((ambient * 6.66) - 1.6);
|
||||
amb[3] = 0.00;
|
||||
#ifdef DEBUG
|
||||
printf("Color of the sun: %f, %f, %f\n"
|
||||
"Ambient value : %f\n"
|
||||
"Sun Angle : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
|
||||
fgPrintf( FG_ASTRO, FG_INFO,
|
||||
"Color of the sun: %f, %f, %f\n"
|
||||
"Ambient value : %f\n"
|
||||
"Sun Angle : %f\n" , amb[0], amb[1], amb[2], ambient, t->sun_angle);
|
||||
#endif
|
||||
diff[0] = 0.0;
|
||||
diff[1] = 0.0;
|
||||
@@ -190,10 +193,14 @@ void fgSunRender( void ) {
|
||||
|
||||
|
||||
/* $Log$
|
||||
/* Revision 1.3 1998/01/19 19:27:00 curt
|
||||
/* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
/* This should simplify things tremendously.
|
||||
/* Revision 1.4 1998/01/27 00:47:50 curt
|
||||
/* Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
|
||||
/* system and commandline/config file processing code.
|
||||
/*
|
||||
* Revision 1.3 1998/01/19 19:27:00 curt
|
||||
* Merged in make system changes from Bob Kuehne <rpk@sgi.com>
|
||||
* This should simplify things tremendously.
|
||||
*
|
||||
* Revision 1.2 1998/01/19 18:40:18 curt
|
||||
* Tons of little changes to clean up the code and to remove fatal errors
|
||||
* when building with the c++ compiler.
|
||||
|
||||
Reference in New Issue
Block a user