Converted to new logstream debugging facility. This allows release

builds with no messages at all (and no performance impact) by using
the -DFG_NDEBUG flag.
This commit is contained in:
curt 1998-11-06 21:17:31 +00:00 committed by Tim Moore
parent aecea627e1
commit 6ef9ecdda0
6 changed files with 42 additions and 29 deletions

View File

@ -25,7 +25,7 @@
#include "celestialBody.hxx" #include "celestialBody.hxx"
#include "star.hxx" #include "star.hxx"
#include <Debug/fg_debug.h> #include <Debug/logstream.hxx>
/************************************************************************** /**************************************************************************
* void CelestialBody::updatePosition(fgTIME *t, Star *ourSun) * void CelestialBody::updatePosition(fgTIME *t, Star *ourSun)
@ -78,8 +78,8 @@ void CelestialBody::updatePosition(fgTIME *t, Star *ourSun)
ze = yg * sin(ecl) + zg * cos(ecl); ze = yg * sin(ecl) + zg * cos(ecl);
rightAscension = atan2(ye, xe); rightAscension = atan2(ye, xe);
declination = atan2(ze, sqrt(xe*xe + ye*ye)); declination = atan2(ze, sqrt(xe*xe + ye*ye));
fgPrintf(FG_GENERAL, FG_INFO, "Planet found at : %f (ra), %f (dec)\n", FG_LOG(FG_GENERAL, FG_INFO, "Planet found at : "
rightAscension, declination); << rightAscension << " (ra), " << declination << " (dec)" );
//calculate some variables specific to calculating the magnitude //calculate some variables specific to calculating the magnitude
//of the planet //of the planet

View File

@ -26,7 +26,7 @@
#include <string.h> #include <string.h>
#include "moon.hxx" #include "moon.hxx"
#include <Debug/fg_debug.h> #include <Debug/logstream.hxx>
#include <Objects/texload.h> #include <Objects/texload.h>
static GLuint moon_texid; static GLuint moon_texid;
@ -51,7 +51,7 @@ Moon::Moon(fgTIME *t) :
string tpath, fg_tpath; string tpath, fg_tpath;
int width, height; int width, height;
fgPrintf( FG_GENERAL, FG_INFO, "Initializing Moon Texture\n"); FG_LOG( FG_GENERAL, FG_INFO, "Initializing Moon Texture");
#ifdef GL_VERSION_1_1 #ifdef GL_VERSION_1_1
xglGenTextures(1, &moon_texid); xglGenTextures(1, &moon_texid);
xglBindTexture(GL_TEXTURE_2D, moon_texid); xglBindTexture(GL_TEXTURE_2D, moon_texid);
@ -77,9 +77,9 @@ Moon::Moon(fgTIME *t) :
if ( (moon_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height)) if ( (moon_texbuf = read_rgb_texture(fg_tpath.c_str(), &width, &height))
== NULL ) == NULL )
{ {
fgPrintf( FG_GENERAL, FG_EXIT, FG_LOG( FG_GENERAL, FG_ALERT,
"Error in loading moon texture %s\n", tpath.c_str() ); "Error in loading moon texture " << tpath );
exit(1); exit(-1);
} }
} }
@ -162,7 +162,7 @@ void Moon::updatePosition(fgTIME *t, Star *ourSun)
r += (-0.58 * cos(M - 2*D) r += (-0.58 * cos(M - 2*D)
-0.46 * cos(2*D) -0.46 * cos(2*D)
); );
fgPrintf(FG_GENERAL, FG_INFO, "Running moon update\n"); FG_LOG(FG_GENERAL, FG_INFO, "Running moon update");
xg = r * cos(lonecl) * cos(latecl); xg = r * cos(lonecl) * cos(latecl);
yg = r * sin(lonecl) * cos(latecl); yg = r * sin(lonecl) * cos(latecl);
zg = r * sin(latecl); zg = r * sin(latecl);
@ -213,8 +213,9 @@ void Moon::newImage(float ra, float dec)
xglRotatef(((RAD_TO_DEG * ra)- 90.0), 0.0, 0.0, 1.0); xglRotatef(((RAD_TO_DEG * ra)- 90.0), 0.0, 0.0, 1.0);
xglRotatef((RAD_TO_DEG * dec), 1.0, 0.0, 0.0); xglRotatef((RAD_TO_DEG * dec), 1.0, 0.0, 0.0);
fgPrintf( FG_GENERAL, FG_INFO, FG_LOG( FG_GENERAL, FG_INFO,
"Ra = (%f), Dec= (%f)", (RAD_TO_DEG *ra), (RAD_TO_DEG *dec) ); "Ra = (" << (RAD_TO_DEG *ra)
<< "), Dec= (" << (RAD_TO_DEG *dec) << ")" );
xglTranslatef(0.0, 58600.0, 0.0); xglTranslatef(0.0, 58600.0, 0.0);
Object = gluNewQuadric(); Object = gluNewQuadric();
gluQuadricTexture( Object, GL_TRUE ); gluQuadricTexture( Object, GL_TRUE );

View File

@ -26,7 +26,6 @@
#define _MOON_HXX_ #define _MOON_HXX_
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Include/general.h> #include <Include/general.h>
#include <Main/views.hxx> #include <Main/views.hxx>

View File

@ -36,7 +36,7 @@
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/logstream.hxx>
#include <Flight/flight.hxx> #include <Flight/flight.hxx>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Main/views.hxx> #include <Main/views.hxx>
@ -78,7 +78,7 @@ void fgSkyVerticesInit( void ) {
float theta; float theta;
int i; int i;
fgPrintf(FG_ASTRO, FG_INFO, " Generating the sky dome vertices.\n"); FG_LOG(FG_ASTRO, FG_INFO, " Generating the sky dome vertices.");
for ( i = 0; i < 12; i++ ) { for ( i = 0; i < 12; i++ ) {
theta = (i * 30.0) * DEG_TO_RAD; theta = (i * 30.0) * DEG_TO_RAD;
@ -115,8 +115,8 @@ void fgSkyColorsInit( void ) {
l = &cur_light_params; l = &cur_light_params;
fgPrintf( FG_ASTRO, FG_INFO, FG_LOG( FG_ASTRO, FG_INFO,
" Generating the sky colors for each vertex.\n" ); " Generating the sky colors for each vertex." );
// setup for the possibility of sunset effects // setup for the possibility of sunset effects
sun_angle = l->sun_angle * RAD_TO_DEG; sun_angle = l->sun_angle * RAD_TO_DEG;
@ -243,7 +243,7 @@ void fgSkyColorsInit( void ) {
// Initialize the sky structure and colors // Initialize the sky structure and colors
void fgSkyInit( void ) { void fgSkyInit( void ) {
fgPrintf(FG_ASTRO, FG_INFO, "Initializing the sky\n"); FG_LOG( FG_ASTRO, FG_INFO, "Initializing the sky" );
fgSkyVerticesInit(); fgSkyVerticesInit();
@ -365,6 +365,11 @@ void fgSkyRender( void ) {
// $Log$ // $Log$
// Revision 1.14 1998/11/06 21:17:39 curt
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
// the -DFG_NDEBUG flag.
//
// Revision 1.13 1998/10/20 18:28:30 curt // Revision 1.13 1998/10/20 18:28:30 curt
// Tweaked sunset/sunrise colors. // Tweaked sunset/sunrise colors.
// //

View File

@ -33,7 +33,7 @@
#include <GL/glut.h> #include <GL/glut.h>
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Debug/fg_debug.h> #include <Debug/logstream.hxx>
#include <Time/sunpos.hxx> #include <Time/sunpos.hxx>
#include "solarsystem.hxx" #include "solarsystem.hxx"
@ -47,7 +47,8 @@ SolarSystem::SolarSystem(fgTIME *t)
{ {
if (theSolarSystem) if (theSolarSystem)
{ {
fgPrintf(FG_GENERAL, FG_EXIT, "Error: only one solarsystem allowed\n"); FG_LOG( FG_GENERAL, FG_ALERT, "Error: only one solarsystem allowed" );
exit(-1);
} }
theSolarSystem = this; theSolarSystem = this;
ourSun = new Star(t); ourSun = new Star(t);

View File

@ -41,7 +41,7 @@
#include <XGL/xgl.h> #include <XGL/xgl.h>
#include <Aircraft/aircraft.hxx> #include <Aircraft/aircraft.hxx>
#include <Debug/fg_debug.h> #include <Debug/logstream.hxx>
#include <Include/fg_constants.h> #include <Include/fg_constants.h>
#include <Misc/fgstream.hxx> #include <Misc/fgstream.hxx>
#include <Main/options.hxx> #include <Main/options.hxx>
@ -70,21 +70,23 @@ int fgStarsInit( void ) {
// double ra_save1, decl_save1; // double ra_save1, decl_save1;
int i, j, starcount, count; int i, j, starcount, count;
fgPrintf( FG_ASTRO, FG_INFO, "Initializing stars\n"); FG_LOG( FG_ASTRO, FG_INFO, "Initializing stars" );
if ( FG_STAR_LEVELS < 4 ) { if ( FG_STAR_LEVELS < 4 ) {
fgPrintf( FG_ASTRO, FG_EXIT, "Big whups in stars.cxx\n"); FG_LOG( FG_ASTRO, FG_ALERT, "Big whups in stars.cxx" );
exit(-1);
} }
// build the full path name to the stars data base file // build the full path name to the stars data base file
string path = current_options.get_fg_root() + "/Astro/stars" + ".gz"; string path = current_options.get_fg_root() + "/Astro/stars" + ".gz";
fgPrintf( FG_ASTRO, FG_INFO, " Loading stars from %s\n", path.c_str() ); FG_LOG( FG_ASTRO, FG_INFO, " Loading stars from " << path );
fg_gzifstream in( path ); fg_gzifstream in( path );
if ( ! in ) if ( ! in ) {
fgPrintf( FG_ASTRO, FG_EXIT, FG_LOG( FG_ASTRO, FG_ALERT, "Cannot open star file: " << path );
"Cannot open star file: '%s'\n", path.c_str() ); exit(-1);
}
starcount = 0; starcount = 0;
@ -195,9 +197,9 @@ int fgStarsInit( void ) {
xglEndList(); xglEndList();
fgPrintf( FG_ASTRO, FG_INFO, FG_LOG( FG_ASTRO, FG_INFO,
" Loading %d stars brighter than %.2f\n", " Loading " << count << " stars brighter than "
count, min_magnitude[i]); << min_magnitude[i] );
} }
return 1; // OK, we got here because initialization worked. return 1; // OK, we got here because initialization worked.
@ -252,6 +254,11 @@ void fgStarsRender( void ) {
// $Log$ // $Log$
// Revision 1.21 1998/11/06 21:17:42 curt
// Converted to new logstream debugging facility. This allows release
// builds with no messages at all (and no performance impact) by using
// the -DFG_NDEBUG flag.
//
// Revision 1.20 1998/11/06 14:47:02 curt // Revision 1.20 1998/11/06 14:47:02 curt
// Changes to track Bernie's updates to fgstream. // Changes to track Bernie's updates to fgstream.
// //